標題:
for 迴圈 (一)
[打印本頁]
作者:
鄭繼威
時間:
2022-7-19 02:25
標題:
for 迴圈 (一)
#range(start,stop,step)
#range(1,6)->[1,2,3,4,5]
直向顯示第1名~第5名
for i in range(1,6):
print("第",i,"名")
複製代碼
作者:
鄭繼威
時間:
2022-7-19 14:10
list1=[0,1,2,3,4,"apple","忠",9,999]
for kevin in list1:
print(kevin,"嗨")
#range(1,100)->[1,2,3,4,5]
for i in range(1,6):
print(f"第{i}名")
list2=[1,2,3,4,5]
for i in list2:
print(f"第{i}名")
複製代碼
作者:
盧宥廷
時間:
2022-7-19 14:13
for i in range(1,6):
print(f"第{i}名")
複製代碼
作者:
盧宥熏
時間:
2022-7-19 14:15
list=[1,2,3,4,5]
for a in list:
print(f"第{a}名")
複製代碼
作者:
陳羨芮
時間:
2022-7-19 14:15
for i in range(1,6):
print("第",i,"名")
複製代碼
作者:
李宥廷
時間:
2022-7-19 14:17
for a in range(1,6):
print("第",a,"名")
複製代碼
作者:
張晏齊
時間:
2022-7-19 14:19
# -*- coding: utf-8 -*-
"""
Spyder Editor
This is a temporary script file.
"""
list1 =[0,1,2,3,4,"apple","忠",9,999]
for Martin in list1:
print(Martin,"嗨")
#range(1,100)->[1,2,3,4,5]
for i in range(1,6):
print(f"第{i}名")
list2=[1,2,3,4,5]
for i in list2:
print(f"第{i}名")
複製代碼
歡迎光臨 種子論壇 | 高雄市資訊培育協會學員討論區 (http://istak.org.tw/seed/)
Powered by Discuz! 7.2