Python String Reversal
Given a string, then reverse it and output it in reverse order.
Example 1: Using string slicing
str='Example'
print(str[::-1])
Executing the above code produces the following output:
boonuR
Example 2: Using reversed()
str='Example'
print(''.join(reversed(str)))
Executing the above code produces the following output:
boonuROther Extensions
Python3 Examples