+ 1

Please how do I write a code to reverse a word in python

I want the word to be spelt backwards

26th Sep 2021, 1:08 PM
bernard
bernard - avatar
2 odpowiedzi
+ 8
bernard Try this word = 'abcd' print(word[::-1])
26th Sep 2021, 1:09 PM
A͢J
A͢J - avatar
+ 1
using list slicing which is the shortest method word = "I am the best" print(word[::-1])
27th Sep 2021, 9:08 AM
iTech
iTech - avatar