+ 1
https://www.sololearn.com/coach/55?ref=app
How to detect space in this problem??🤔🤔(Code Coach:Spy Life)
1 Antwort
+ 2
This the code I wrote for this challange:
text = input()
result = "".join(c for c in text if c.isalpha() or c == " ")
print(result[::-1])
You can either write c == " " or c.isspace.
if c.isalpha detects all alphabetical characters and if c.isspace detects white spaces in the c.