Advertisement
Guest User

Untitled

a guest
Sep 4th, 2017
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.19 KB | None | 0 0
  1. # Pizza Perfection
  2. import random # Imports the Random Module
  3.  
  4. #-=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=-
  5. def Register_Username():
  6. global username
  7. username = input("Before you start, you must register. Please enter a suitable username: ")
  8. print("Thank you.\n")
  9. Register_Password()
  10. #-=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=-
  11. def Register_Password():
  12. global password
  13. password = input("Please enter a password. It must be at least 8 characters long: ")
  14. while len(password) < 8:
  15. print("This password is too short.")
  16. Register_Password()
  17. print("Thank you. You have successfully registered and may now access the system.")
  18. Menu()
  19. #-=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=-
  20. def Login_Username():
  21. while True:
  22. try:
  23. if username == username:
  24. break
  25. except NameError:
  26. print("You have not successfully registered, please register before accessing the system.")
  27. Menu()
  28. attempted_username = input("\n\n\nPlease login by firstly entering your username: ")
  29. if attempted_username != username:
  30. print("The username entered does not match an account already registered, please try again.")
  31. Login_Username()
  32. else:
  33. Login_Password()
  34. #-=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=-
  35. def Login_Password():
  36. attempted_password = input("\n\nThis username matches a registered account. Please enter the password associated with this account: ")
  37. if attempted_password != password:
  38. print("The password entered does not match with the username entered, please try again.")
  39. Login_Password()
  40. else:
  41. print("You have successfully logged in. You are now being directed to the system.")
  42. PizzaPerfection()
  43. #-=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=-
  44. def PizzaPerfection():
  45. print("pizzz")
  46. #-=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=-
  47. def Quit(): # Defining the Function "Quit".
  48. print("You are now quitting the program...") # Alerts the user that the program is now going to quit.
  49. print("Please press the ENTER key.") # Alerts the user on how to close the program completely.
  50. print("If you wish to cancel this, then call the Menu Function using Menu() after pressing 'Cancel' on Quit.") # Lets the user cancel the quit if they would like to.
  51. quit() # This will quit the program.
  52. #-=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=-
  53. def Menu():
  54. print(
  55. """
  56. +-----------|----------------------------------------|-----------+
  57. +-----------| Pizza Perfection: |-----------+
  58. +-----------| 1 - Register |-----------+
  59. +-----------| 2 - Start the system |-----------+
  60. +-----------| 3 - Quit |-----------+
  61. +-----------|----------------------------------------|-----------+
  62. """
  63. )
  64. program = input("Please enter a program number: ")
  65. if program == "1":
  66. Register_Username()
  67. elif program == "2":
  68. Login_Username()
  69. elif program == "3":
  70. Quit()
  71. else:
  72. print("This is not a valid program number.\nYou are now being returned to the Main Menu.")
  73. Menu()
  74. Menu()
  75. #-=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=-
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement