1 方法一,使用[::-1]: 2 3 s = ‘python‘ 4 print(s[::-1]) 5 6 7 方法二,使用reverse()方法: 8 9 n = list(s) 10 n.reverse() 11 print(‘‘.join(n)) 12 13 results: 14 15 nohtyp 16 nohtyp
标签:log body python3 div 使用 col eve ever int
1 方法一,使用[::-1]: 2 3 s = ‘python‘ 4 print(s[::-1]) 5 6 7 方法二,使用reverse()方法: 8 9 n = list(s) 10 n.reverse() 11 print(‘‘.join(n)) 12 13 results: 14 15 nohtyp 16 nohtyp
标签:log body python3 div 使用 col eve ever int
原文地址:https://www.cnblogs.com/jonm/p/8269872.html