您的位置:首页 > 编程语言 > Python开发

在Python中以相反顺序遍历列表 - Traverse a list in reverse order in Python

2020-07-14 06:42 1001 查看

精选30+云产品,助力企业轻松上云!>>>

问题:

So I can start from len(collection) and end in collection[0] . 因此,我可以从len(collection)并以collection[0]结尾。

EDIT: Sorry, I forgot to mention I also want to be able to access the loop index. 编辑:对不起,我忘了提及我也希望能够访问循环索引。

解决方案:

参考一: https://stackoom.com/question/2Dj6/在Python中以相反顺序遍历列表
参考二: https://oldbug.net/q/2Dj6/Traverse-a-list-in-reverse-order-in-Python
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  python
相关文章推荐