Three methods [the Python] string achieve the reverse order

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

Guess you like

Origin www.cnblogs.com/qsmyjz/p/11987815.html