Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
jackfrued
GitHub Repository: jackfrued/Python-100-Days
Path: blob/master/公开课/年薪50W+的Python程序员如何写代码/code/Python/opencourse/part02/idiom04.py
3078 views
1
fruits = ['orange', 'grape', 'pitaya', 'blueberry']
2
3
# index = 0
4
# for fruit in fruits:
5
# print(index, ':', fruit)
6
# index += 1
7
8
for index, fruit in enumerate(fruits):
9
print(index, ':', fruit)
10
11