Challenge: Text Report
Completed
Read a sentence and print a short report about it:
Upper: <sentence in capitals> Characters: <number of characters> Words: <number of words> Reversed: <sentence backwards>
Input
One line of text.
Output
The four lines shown above.
Example
Input
Python is fun
Output
Upper: PYTHON IS FUN Characters: 13 Words: 3 Reversed: nuf si nohtyP
Editor
Python
Hints
len(text) counts characters; len(text.split()) counts words.
text[::-1] reverses a string.
Solution explanation
Each line uses one tool from this module: upper(), len(), split() and slicing with a step of -1.
Show solution
text = input()
print(f"Upper: {text.upper()}")
print(f"Characters: {len(text)}")
print(f"Words: {len(text.split())}")
print(f"Reversed: {text[::-1]}")