Python中如何迭代(遍历)list、dict

本篇博客介绍Python中list、dict的迭代方法(遍历方法),即在for循环中使用list、dict的方法。python 1. list的迭代 1.1 普通迭代 #!/usr/bin/env python def test_list(): numbers = [1, 2, 3, 4, 5, 6] for num in numbers: print num
相关文章
相关标签/搜索