-5

I have a string:

ahdeg

What is the best way to reverse a string in python so it would be:

gedha

Anything would help, thanks!

Trogi
  • 5
  • 2

1 Answers1

-2

Say you have a string.

string = 'Test'

string[::-1] would reverse this into 'tseT'

Josep Valls
  • 5,483
  • 2
  • 33
  • 67
drs6222
  • 606
  • 3
  • 10