Challenge: Type Detective
Completed
Read one line of text and print three things about it:
- The text itself
- How many characters it has
- The text repeated twice, joined by a dash
-
Input
One line of text.
Output
Three lines. For hi the output is hi, 2, hi-hi.
Example
Input
hi
Output
hi 2 hi-hi
Editor
Python
Hints
len() counts characters, including spaces.
Join strings with +.
Solution explanation
len(text) counts the characters and text + "-" + text joins three strings.
Show solution
text = input()
print(text)
print(len(text))
print(text + "-" + text)