1# in order to make a string reversed in python
2# you have to use the slicing as following
3
4string = "racecar"
5print(string[::-1])
6
1def rev(s):
2 new = ''
3 for char in s:
4 new = char + new
5 print(new)
6
7s = input()
8rev(s)
9
10#code by fawlid
1string = 'hello people of india'
2words = string.split() #converts string into list
3print(words[::-1])
1str="Python" # initial string
2stringlength=len(str) # calculate length of the list
3slicedString=str[stringlength::-1] # slicing
4print (slicedString) # print the reversed string