Guys is this reverse function will be applicable to string? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
26th Jun 2018, 9:08 AM
Sunil Chettri
Sunil Chettri - avatar
4 Answers
+ 10
Sunil Chettri Why tho? The function can reverse a list.
26th Jun 2018, 9:31 AM
Nikhil
Nikhil - avatar
+ 11
You'll have to convert the string in a list first, like - list("String") and then you can call the function~ print(reverse(list("String"))))
26th Jun 2018, 9:18 AM
Nikhil
Nikhil - avatar
+ 2
you could do a = a[::-1]
26th Jun 2018, 12:10 PM
Markus Kaleton
Markus Kaleton - avatar
+ 1
Then we have to convert list into tuple?Is it so @Nikhil
26th Jun 2018, 9:30 AM
Sunil Chettri
Sunil Chettri - avatar