+ 2
Extra Terrestrial StĂŒck!
word = "garbage" print(word[::-1]) word = "bathroom" print(word[::-1]) It shows as an error It's printing together instead of printing separately
9 Answers
+ 2
Try this instead
word=input()
print(word[::-1])
+ 1
Your code, as you posted it in the question, reverses two words and prints them in two lines.
If you get an error, you haven't showed us all we need to know!
0
word = "garbage"
print(word[::-1])ji
word = "bathroom"
print(word[::-1])
0
I want to print them I separate lines
0
The error showing up is that it prints in two lines together. But the solution wants to print one line for test 1. The another line for test 2.
0
The output is showing two lines for both test 1 & test 2
0
Here is my code:
en = str(input())
alien = en.replace(en[0::1],en[-1::-1])
print(alien)
0
Simplest ans :
words = list(input())
words1 = words[::-1]
print("" .join(words1) )