a="3432535541787" 1: print(a[::-1]) 2: b=list(a) b.reverse() print(''.join(b)) 3: c=len(a)-1 str_1=[] while(c>=0): str_1.append(a[c]) c -=1 print(''.join(c))
Three methods of reverse string
a="3432535541787" 1: print(a[::-1]) 2: b=list(a) b.reverse() print(''.join(b)) 3: c=len(a)-1 str_1=[] while(c>=0): str_1.append(a[c]) c -=1 print(''.join(c))
Three methods of reverse string