How to reverse a string in python

Reverse a string in python

Input:
a = 'computer'

Source code:
a[::-1]

output:
'retupmoc'

Comments