Python-29 - 陣列介紹 - 使用for_in 讀取 list 內一筆筆的資料

使用for_in 讀取 list 內一筆筆的資料 


 

複習:

for abc in range(8):
    print(abc)
    print("hi")

 

使用for迴圈讀陣列list 一筆一筆讀出

student_id=list(("B001","B002","B003","B004","B005"))

for ss in student_id :
    print(ss)

student_id=["B001","B002","B003","B004","B005"]

for ss in student_id :
    print(ss)

每一圈只讀一筆

看看效果

 

Yiru@Studio - 關於我 - 意如