0
How to take an input and reverse it
Reverse
16 Antworten
+ 6
print(input()[::-1])
+ 7
input()[::-1]
+ 4
zaid raashid it is correct
+ 3
I and SAYED🇧🇩🇵🇸 has already answered your question
+ 3
str = input() #taking input as string
str = str[::-1] # reversing using slicing
print(str)
+ 2
zaid raashid [::-1] is slicing from backwards of the string.
+ 2
zaid raashid i think you have skipped the lesson on slicing . search on google and learn more about slicing.
+ 2
zaid raashid we didn't use list.reverse() because our input is string not a list.
+ 1
Thank you all and specially sayed for taking out some time and helping me😃😃😃
- 1
It doesn't work
- 1
Write me a small programm plzz
- 1
What does this[::-1] do can you plzz explain
- 1
Why did you not use list.reverse()
- 1
What is slicing