spacepaste

  1.  
  2. def main():
  3. l = []
  4. asko = input("Do you want to perform a list operation? ").strip().lower()
  5. while True:
  6. if asko == "yes":
  7. ask = input("Do you want to test, peek, add, or remove? ").strip().lower()
  8. if ask == "test":
  9. if not l:
  10. print("The list is not empty")
  11. else:
  12. print("The list is empty")
  13. elif ask == "peek":
  14. print(l[0])
  15. elif ask == "add":
  16. askn = int(input("What number do you want to add? ").strip().lower())
  17. l.append(askn)
  18. elif ask == "remove":
  19. l.pop(0)
  20. print(l)
  21. elif asko == "no":
  22. break
  23. else:
  24. print("Please say 'yes' or 'no'.")
  25.