簡單介紹 python list 用法
candidate=["Lai","Hou","Ko","Guo"]
print(candidate[0])
print(candidate[1])
print(candidate[2])
print(candidate[3])
Terminal 印出
Lai
Hou
Ko
Guo
-------------------------------------------
candidate=["Lai","Hou","Ko","Guo"]
for i in candidate:
print(i)
Terminal 印出
Lai
Hou
Ko
Guo
-------------------------------------------
candidate=["Lai","Hou","Ko","Guo"]
for i in range(len(candidate)):
print(candidate[i])
Terminal 印出
Lai
Hou
Ko
Guo
Python List 的簡單用法