16 lines
440 B
Python
16 lines
440 B
Python
def transform(s):
|
|
"""Apply three string transformations and return them in a dict.
|
|
|
|
Keys:
|
|
"upper" — s.upper()
|
|
"lower" — s.lower()
|
|
"clean" — s stripped of leading/trailing whitespace,
|
|
lowercased, with spaces replaced by underscores
|
|
|
|
transform(" Hello World ") returns:
|
|
{"upper": " HELLO WORLD ",
|
|
"lower": " hello world ",
|
|
"clean": "hello_world"}
|
|
"""
|
|
pass
|