0
How to reverse a string?
For example: "Daniel" convert to "leinaD"
4 Respuestas
+ 6
a=input()
print(a[::-1])
As Yaroslav Vernigora said it is slicing operation...learn through python beginners course.
+ 8
unique ,
we can also use the built-in function reversed(). since it returns a reversed object, we need to use join() to get a final string.
several other ways for reversing are possible by using a for a loop or recursion or ...
+ 3
Hi! place the word in the list and then use slices to display it in reverse order
- 1
Hi, please write a example code