14 lines
390 B
Python
14 lines
390 B
Python
def info(s):
|
|
"""Return a dict describing the string s.
|
|
|
|
Keys:
|
|
"first" — the character at index 0
|
|
"sixth" — the character at index 5
|
|
"last" — the character at index -1
|
|
"length" — total number of characters
|
|
|
|
info("MISSION-CONTROL-7") -> {"first": "M", "sixth": "O",
|
|
"last": "7", "length": 17}
|
|
"""
|
|
pass
|