python中的reverse

it2026-05-10  6

python中的reverse

reverse()将列表中的所有元素位置反转,举个例子:

a = [1, 2, 3, 4, 5] a.reverse() print(a)

输出结果:

[5, 4, 3, 2, 1] posted on 2019-04-09 10:03 恒笛 阅读( ...) 评论( ...) 编辑 收藏

转载于:https://www.cnblogs.com/xwqhl/p/10675140.html

最新回复(0)