10 Respuestas
+ 2
The solution to the problem is to reverse the string. So, we can do this once we have the input which we'll call message:
print(message[::-1])
This uses Python's slice functions to loop through the string from the end to the beginning, by a step of one.
+ 2
David Epstein I know it did not work out, but you have to share you attempt here. Post your code so we can help you fix it.
+ 2
Here you go. Done in Python.
word = input()
word2 = []
def alientalk(x):
for i in range(1,len(x)+1):
word2.append(x[-i])
print(x[-i])
alientalk(word)
+ 1
Your attempt ?
+ 1
lets just say it didn’t work out
+ 1
word=input('')
print(word[::-1])
This is the answer
+ 1
TXH thanks
+ 1
word =input()
alien=""
for i in range(len(word),0,-1):
print(word[i-1])
alien=alien+word[i-1]
print(alien)
+ 1
Insertstr="garbage"
print(insertstr[-1::-1])
It'll give egabrag as output
0
My attempt (beginner's)
Word="garbage"
Print"egabrag"
Then:
Word="bathroom"
Print "moorhtab"
I know it's wrong. Any support is appreciated 🙏