返回列表 發帖
  1. list=["忠","孝","仁","愛","信","義","和","平"]

  2. print(list[0:4])
  3. print(list[4:8])
  4. print(list[7:8])
  5. print(list[0:8])
  6. print(list[0:10:2])
  7. print(list[::2])
  8. print(list[::-1])
  9. print(list[::-2])
  10. print(list[1::2])
  11. print(list[1:9:2])
  12. print(list[-4:-1])
複製代碼

TOP

返回列表