string.reverse() python3 code example
Example: python reverse a string
#linear
def reverse(s):
str = ""
for i in s:
str = i + str
return str
#splicing
'hello world'[::-1]
#linear
def reverse(s):
str = ""
for i in s:
str = i + str
return str
#splicing
'hello world'[::-1]