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
1str="Python" # initial string
2stringlength=len(str) # calculate length of the list
3slicedString=str[stringlength::-1] # slicing
4print (slicedString) # print the reversed string
1#linear
2
3def reverse(s):
4 str = ""
5 for i in s:
6 str = i + str
7 return str
8
9#splicing
10'hello world'[::-1]