返回列表 發帖
  1. list=["忠","孝","仁","愛","信","義","和","平"]
  2. print(list[1:6])
  3. list.append(369)
  4. print(f"list.append:{list}")
  5. list.insert(3,"ABC")
  6. print(f"list.insert:{list}")
  7. list.pop(1)
  8. print(f"list.pop:{list}")
  9. list.remove("愛")
  10. print(f"list.remove:{list}")
  11. list.reverse()
  12. print(f"list.reverse:{list}")
複製代碼

TOP

list=[12,-3,-50,32,25,11]
list.sort()
print(list)
list.reverse()
print(list)
list.pop(5)
print(list)
list.append(-20)
print(list)
list.insert(5,0)
print(list)

TOP

  1. list=["d","e","m","i","s","e"]
  2. print("normal:",list[0:7])
  3. list.reverse()
  4. print("reverse",list[0:7])
  5. list.reverse()
  6. list.pop()
  7. print("pop",list[0:6])
複製代碼
Attention Seeker </3

TOP

返回列表