Advertisement
Guest User

Untitled

a guest
Sep 30th, 2017
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.44 KB | None | 0 0
  1. def menu():
  2. print("Login System")
  3. print("1 to login")
  4. print("2 to register")
  5. print("x to exit")
  6. return input("choose an option: ")
  7.  
  8. def login():
  9. while True:
  10. answer=input("Would you like to login? ")
  11. if answer=="yes":
  12. username=input("Enter your username: ")
  13. password=input("Emter your password: ")
  14. else:
  15. break
  16.  
  17. def register():
  18. while True:
  19. answer=input("Would you like to register? ")
  20. if answer=="yes":
  21. username=input("create a username: ")
  22. password=input("create a password: ")
  23. else:
  24. break
  25. while True:
  26. choice=menu()
  27. if choice=="1":
  28. login()
  29. elif choice=="2":
  30. register()
  31. elif choice=="x":
  32. break
  33. else:
  34. print("not a valid choice")
  35.  
  36. def menu():
  37. print("Quiz selection")
  38. print("--------------")
  39. print("H for History")
  40. print("C for Computer science")
  41. print("M for Music")
  42. print("X to quit")
  43. return input("choose an option")
  44.  
  45. def History():
  46. while True:
  47. answer=input("would you like to take the quiz in easy medium or hard level? ")
  48.  
  49. while True:
  50. choice=menu()
  51. if choice=="H":
  52. History()
  53. elif choice=="C":
  54. Computer_science()
  55. elif choice=="M":
  56. Music()
  57. elif choice=="X":
  58. break
  59. else:
  60. print("not a valid option")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement