標題:
串列 (一)
[打印本頁]
作者:
陳品肇
時間:
2020-2-2 09:00
標題:
串列 (一)
假設有一串列其內容如下:
list=["忠","孝","仁","愛","信","義","和","平"]
試取出串列中的第1到第5個元素
[attach]8361[/attach]
list=["忠","孝","仁","愛","信","義","和","平"]
print(list[1:6])
複製代碼
作者:
許雅棟
時間:
2020-2-2 10:33
list=["忠","孝","仁","愛","信","義","和","平"]
print(list[1:6])
複製代碼
作者:
黃紹綸
時間:
2020-2-2 10:33
list=["忠","孝","仁","愛","信","義","和","平"]
print(list[1:6])
複製代碼
作者:
陳頡鴻
時間:
2020-2-2 10:34
list1=["忠","孝","仁","愛","信","義","和","平"]
print(list1[1:6])
複製代碼
作者:
曾顗文
時間:
2020-2-2 10:34
list=["忠","孝","仁","愛","信","義","和","平"]
print(list[1:6])
複製代碼
作者:
曾柏忻
時間:
2020-2-2 10:35
list=["忠","孝","仁","愛","信","義","和","平"]
print(list[1:6])
複製代碼
作者:
李穎俊
時間:
2020-2-2 10:35
list=["忠","孝","仁","愛","信","義","和","平"]
print(list[1:6])
複製代碼
作者:
黃紹恩
時間:
2020-2-2 10:35
list1=["忠","孝","仁","愛","信","義"]
print(list1[1:6])
複製代碼
作者:
林依玟
時間:
2020-2-2 10:35
list=["忠","孝","仁","愛","信","義"]
print(list[1:6])
複製代碼
作者:
陳沛頤
時間:
2020-2-2 10:35
list2=["0","1","2","3","4","5","6"]
print(list2[1:6])
複製代碼
作者:
林奇陞
時間:
2020-2-2 10:36
list=["忠","孝","仁","愛","信","義","和","平"]
print(list[1:6])
複製代碼
作者:
傅英哲
時間:
2020-2-2 10:37
list=["忠","孝","仁","愛","信","義","和","平"]
print(list[1:6])
複製代碼
作者:
張鈞堯
時間:
2020-2-2 10:37
a=[1,2,3,4,5]
b=['a','b','c','d','e']
c=[1,'a',2,'b',3]
print(a[0:6])
print(a[0:5])
print(a[2:4])
print(b[2:4])
print(c[2:4])
print(a,b,c)
print(b[1])
print(a[1])
print(c[1])
複製代碼
作者:
黃柏叡
時間:
2020-2-2 10:37
list1=[1,2,3,4,5,6,7,8,9]
list2=["忠","孝","仁","愛","信","義","和","平"]
list3=["看",1,2,"山"]
print(list2[1:6])
複製代碼
作者:
傅品翰
時間:
2020-2-2 10:37
list=["忠","孝","仁","愛","信","義","和","平"]
print(list[1:6])
複製代碼
作者:
潘堉恩
時間:
2020-2-2 10:41
list=["忠","孝","仁","愛","信","義","和","平"]
print(list[1:6])
複製代碼
歡迎光臨 種子論壇 | 高雄市資訊培育協會學員討論區 (http://seed.istak.org.tw/)
Powered by Discuz! 7.2