Codington
0 of 6 problems solved • 0%

Exercise prompt

Make an Initial

The supplied helper removes surrounding whitespace. You can save the returned text in a local variable before taking its first character.

Example

def word(text): return text.strip() def loud(text): return word(text).upper() print(loud(" stop! ")) # STOP!

loud receives the string returned by word before it uppercases anything.

Your task

Complete initial(text) to return the first character of the cleaned text in uppercase, or an empty string when the cleaned text is empty. A slice ending at 1 also works on empty text.