返回列表 發帖
list1=[1,2,3,4,"banana",5,6,]
print(list1[0])
print(list1[2:6])
print(list1[-1:4])
print(len(list1)-1)

TOP

list1=[2,6,2,"apple",2.6,[5,6]]
print(list1[0])
print(list1[5])
print(list1[0:3])
print(list1[1:4])
print(list1[-1])

TOP

  1. a=[1,2,3,4,5,6,7,8,9,10]
  2. print(a)
  3. print(a[5])
  4. print(a[0:5])
  5. print(a[-1])
複製代碼

TOP

返回列表