4.2-5 イテレラブルの要素に添字を割り当てる
enumerateの構文 enumerate(iterale, start=0)
w_list = ["apple", "grape", "banana"]
for idx, data in enumerate(w_list):
print(idx, data, sep=":")
->
0:apple
1:grape
2:banana
enumerateの構文 enumerate(iterale, start=0)
w_list = ["apple", "grape", "banana"]
for idx, data in enumerate(w_list):
print(idx, data, sep=":")
->
0:apple
1:grape
2:banana