0
E.T code coach help plz
Input Format: A string of a word in English. Output Format: A string of the reversed word that represents the original word translated into alien language. So I know I use the x.reverse() function but everything I try isnât working, what am I doing wrong? I tried x=[input()] Print (x.reverse())
2 Answers
+ 1
You are making a list with single value. Reversing it will same list.
x.reverse() works on original list. So returns none.
But what you need is reverse input string.. Your code, no way near to problem..
x = [2, 3,4]
x.reverse()
print(x)
This is correct way buy on list..
String has no method of reverse()
You can use slicing or a loop to reverse a string...
Take string as just
x = input()
Then go on to reverse it.
0
# Hi! Hereâs a way to use reversed():
print("".join(reversed("hello world")))