字符串翻转输出:
a="I am tom" b=a.split(" ") print(b) b.reverse() print(b)
[‘I‘, ‘am‘, ‘tom‘]
[‘tom‘, ‘am‘, ‘I‘]
字符串翻转输出:
a="I am tom" b=a.split(" ") print(b) b.reverse() print(b)
[‘I‘, ‘am‘, ‘tom‘]
[‘tom‘, ‘am‘, ‘I‘]
原文:https://www.cnblogs.com/lily1989/p/8570951.html