Easy Tutorial
❮ Python Func Number Ceil Python String Isalpha ❯

Python String Reversal

Python3 Examples

Given a string, reverse it and output the result in reverse order.

Example 1: Using String Slicing

str='tutorialpro'
print(str[::-1])

Executing the above code outputs:

orpalu

Example 2: Using reversed()

str='tutorialpro'
print(''.join(reversed(str)))

Executing the above code outputs:

orpalu

Python3 Examples

❮ Python Func Number Ceil Python String Isalpha ❯