Skip to content

Latest commit

 

History

History
5 lines (3 loc) · 221 Bytes

How to reverse a string in python.md

File metadata and controls

5 lines (3 loc) · 221 Bytes

Reverse String in Python

To reverse the string in python use [::-1].

  • For example if you got a = 'This is a string!' you can do a = a[::-1]. This will reverse the string and store it in the same variable a.