標題:
for 迴圈 (二)
[打印本頁]
作者:
鄭繼威
時間:
2023-7-10 15:59
標題:
for 迴圈 (二)
假設有一串列其內容如下:
list=["忠","孝","仁","愛","信","義","和","平"]
試以for迴圈,橫向顯示串列中的所有元素。
list=["忠","孝","仁","愛","信","義","和","平"]
for s in list:
print(s,end=" ")
複製代碼
list=["忠","孝","仁","愛","信","義","和","平"]
for i in range(0,8):
print(list[i],end=" ")
複製代碼
作者:
方昱安
時間:
2023-7-11 10:33
list1=["忠","孝","仁","愛","信","義","和","平"]
for i in list1:
print(i,end="")
複製代碼
作者:
劉恆
時間:
2023-7-11 10:52
list=["忠","孝","仁","愛","信","義","和","平"]
for s in list:
print(s,end=" ")
作者:
董炫霆
時間:
2023-7-11 10:55
list2=["仁","義","禮","智","信","忠","孝","和"]
for i in range(0,8):
print(list2[i],end=" ")
複製代碼
作者:
歐陽霖
時間:
2023-7-11 10:58
list3=["和","平","誠","信","敬","業","樂","群" ]
for i in list3:
print(i,end=" ")
複製代碼
作者:
曾冠瑋
時間:
2023-7-11 11:01
list1=["忠","孝","仁","愛","信","義","和","平"]
for i in list1:
print(i,end=" ")
作者:
黃柏翰
時間:
2023-7-11 11:02
list=["忠","孝","仁","愛","信","義","和","平"]
for s in list:
print(s,end=" ")
作者:
張育維
時間:
2023-7-11 11:04
listD=["氫","鋰","鈉","鉀","銣","銫","砝"]
listE=[1,2,3,4,5,6,7]
for i in listD:
print(i,end=" ")
print()
for i in range(7):
print(f"元素週期表第{listE[i]}個是{listD[i]}")
複製代碼
作者:
董恩瑞
時間:
2023-7-11 11:45
list=["忠","孝","仁","愛","信","義","和","平"]
for s in list:
print(s,end=" ")
作者:
盧承新
時間:
2023-8-3 10:54
a=["忠","孝","仁","愛","信","義","和","平"]
for i in a:
print(i,end=" ")
複製代碼
作者:
盧芷萱
時間:
2023-8-3 10:54
list=["忠","孝","仁","愛","信","義","和","平"]
for s in list:
print(s,end=" ")
複製代碼
作者:
高士涵
時間:
2023-8-3 10:54
list=["忠","孝","仁","愛","信","義","和","平"]
for i in list:
print(i,end=" ")
複製代碼
作者:
呂宗晉
時間:
2023-8-3 10:55
list=["忠","孝","仁","愛","信","義","和","平"]
for s in list:
print(s,end=" ")
複製代碼
作者:
張子搴
時間:
2023-8-3 10:55
list=["忠","孝","仁","愛","信","義","和","平"]
for i in list:
print(i,end=" ")
複製代碼
作者:
鄧維成
時間:
2023-8-3 10:55
list=["忠","孝","仁","愛","信","義","和","平"]
for i in range(0,8):
print(list[i],end=" ")
複製代碼
作者:
得銓
時間:
2023-8-3 10:56
list=["忠","孝","仁","愛","信","義","和","平"]
for s in list:
print(s,end=" ")
複製代碼
作者:
陳珺
時間:
2023-8-3 10:56
list=["忠","孝","仁","愛","信","義","和","平"]
for i in list:
print(i,end=i)
作者:
李逢翔
時間:
2023-8-3 10:56
list=["忠","孝","仁","愛","信","義","和","平"]
for i in range(0,8):
print(list[i],end="")
複製代碼
作者:
張絜晰
時間:
2023-8-3 10:56
list=["a","b","c","d","e","f","g","h"]
for s in list:
print(s,end=" ")
複製代碼
歡迎光臨 種子論壇 | 高雄市資訊培育協會學員討論區 (http://istak.org.tw/seed/)
Powered by Discuz! 7.2