我正在深入研究Python,我对每次迭代都有一个问题.我是Python新手,对C#有一些经验.所以我想知道,在Python中是否有一些等价的函数用于迭代我的集合中的所有项,例如.
pets = ['cat', 'dog', 'fish']
marks = [ 5, 4, 3, 2, 1]
或者类似的.
我正在深入研究Python,我对每次迭代都有一个问题.我是Python新手,对C#有一些经验.所以我想知道,在Python中是否有一些等价的函数用于迭代我的集合中的所有项,例如.
pets = ['cat', 'dog', 'fish']
marks = [ 5, 4, 3, 2, 1]
或者类似的.
好的.一个for循环.
for f in pets:
print f