倒序输出字符串中元素:
a = 'abc edf degd' r_a = a[::-1] print(r_a)
倒叙输出list列表元素(同reverse()函数):
a = 'abc edf degd' print(a.split()[::-1])
倒序输出字符串中元素:
a = 'abc edf degd' r_a = a[::-1] print(r_a)
倒叙输出list列表元素(同reverse()函数):
a = 'abc edf degd' print(a.split()[::-1])