返回列表 發帖
  1. list=[2004,6,22,2005,2,5]
  2. print("Unsorted: ", list)
  3. list.sort()
  4. print("From least to Greatest:", list)
  5. list.reverse()
  6. print("From Greatest to Least: ", list)
  7. print("Numer of Elements: ", len(list))
  8. list. pop(5)
  9. print("After Deleting one Element: ", list)
  10. list. pop(2)
  11. print("After Deleting two Elements: ", list)
  12. list. append(9)
  13. list.sort()
  14. print("After Adding a new Element: ", list)
  15. list. append(23)
  16. list.sort()
  17. print("After Adding two new Elements: ", list)
  18. list. pop(1)
  19. print("After Deleting one Element: ", list)
  20. list. pop(0)
  21. print("After Deleting two Elements: ", list)
  22. list.insert(0,3)
  23. print("After Adding a new Element: ", list)
  24. list.insert(1,4)
  25. list.sort()
  26. print("After Adding a new Element: ", list)
複製代碼
._.

TOP

返回列表