攝影或3C

Python: enumerate 遍歷 ; lst1 = list( enumerate (seasons, start=1) ) ; for idx, sea in  enumerate (seasons, start=1): print(idx,sea)

seasons = [“Spring”, “Summer”, “Fall”, “Winter”]
lst = list( enumerate(seasons) ) #e- nu-me-rate: 列舉,羅列,歷數,遍歷
print( lst )

lst1 = list( enumerate(seasons,start=1) )
print( lst1 )

seasons = [“Spring”,”Summer”,”Fall”,”Winter”]
lst = list( enumerate(seasons) )  #e-nu-me-rate
print( lst  )

lst1 = list( enumerate(seasons, start=1) )
print( lst1  )

for idx, sea in  enumerate(seasons, start=1):
  print(idx,sea)
print(“===一般for迴圈===”)
idx=1
for sea in seasons:
  print(idx,sea)
  idx += 1
儲蓄保險王

儲蓄險是板主最喜愛的儲蓄工具,最喜愛的投資理財工具則是ETF,最喜愛的省錢工具則是信用卡