Advertisement
Guest User

asdasdasdasdasd

a guest
Oct 21st, 2017
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1. import os
  2. list = ['Dog', 'Cat']
  3. def menu():
  4. print "1 - add text to list"
  5. print "2 - remove text from the list"
  6. print "3 - print the list"
  7. print "4 - exit"
  8.  
  9. menu()
  10. x = int(raw_input("Insert your option: "))
  11.  
  12. if x == 1:
  13. y = str(raw_input("Insert your text: "))
  14. list.append(y)
  15. os.system("cls")
  16. menu()
  17. x = int(raw_input("Insert your option: "))
  18.  
  19. if x == 2:
  20. z = str(raw_input("Insert your text: "))
  21. list.remove(z)
  22. menu()
  23. x = int(raw_input("Insert your option: "))
  24.  
  25. if x == 3:
  26. print list
  27. menu()
  28. x = int(raw_input("Insert your option: "))
  29. if x == 4:
  30. exit()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement