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

加入好友
加入社群
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 )

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  )

for idx, sea in  enumerate(seasons, start=1):
    print(idx,sea)
   
print(“===一般for迴圈===”)
idx=1
for sea in seasons:
    print(idx,sea)
    idx += 1
Python: enumerate 遍歷 ; lst1 = list( enumerate (seasons, start=1) ) ; for idx, sea in  enumerate (seasons, start=1): print(idx,sea) - 儲蓄保險王
 

加入好友
加入社群
Python: enumerate 遍歷 ; lst1 = list( enumerate (seasons, start=1) ) ; for idx, sea in  enumerate (seasons, start=1): print(idx,sea) - 儲蓄保險王

儲蓄保險王

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

You may also like...

發佈留言

發佈留言必須填寫的電子郵件地址不會公開。 必填欄位標示為 *