-
- def main():
- l = []
- asko = input("Do you want to perform a list operation? ").strip().lower()
- while True:
- if asko == "yes":
- ask = input("Do you want to test, peek, add, or remove? ").strip().lower()
- if ask == "test":
- if not l:
- print("The list is not empty")
- else:
- print("The list is empty")
-
- elif ask == "peek":
- print(l[0])
-
- elif ask == "add":
- askn = int(input("What number do you want to add? ").strip().lower())
- l.append(askn)
-
- elif ask == "remove":
- l.pop(0)
-
- print(l)
- elif asko == "no":
- break
- else:
- print("Please say 'yes' or 'no'.")
-