Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Pizza Perfection
- import random # Imports the Random Module
- #-=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=-
- def Register_Username():
- global username
- username = input("Before you start, you must register. Please enter a suitable username: ")
- print("Thank you.\n")
- Register_Password()
- #-=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=-
- def Register_Password():
- global password
- password = input("Please enter a password. It must be at least 8 characters long: ")
- while len(password) < 8:
- print("This password is too short.")
- Register_Password()
- print("Thank you. You have successfully registered and may now access the system.")
- Menu()
- #-=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=-
- def Login_Username():
- while True:
- try:
- if username == username:
- break
- except NameError:
- print("You have not successfully registered, please register before accessing the system.")
- Menu()
- attempted_username = input("\n\n\nPlease login by firstly entering your username: ")
- if attempted_username != username:
- print("The username entered does not match an account already registered, please try again.")
- Login_Username()
- else:
- Login_Password()
- #-=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=-
- def Login_Password():
- attempted_password = input("\n\nThis username matches a registered account. Please enter the password associated with this account: ")
- if attempted_password != password:
- print("The password entered does not match with the username entered, please try again.")
- Login_Password()
- else:
- print("You have successfully logged in. You are now being directed to the system.")
- PizzaPerfection()
- #-=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=-
- def PizzaPerfection():
- print("pizzz")
- #-=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=-
- def Quit(): # Defining the Function "Quit".
- print("You are now quitting the program...") # Alerts the user that the program is now going to quit.
- print("Please press the ENTER key.") # Alerts the user on how to close the program completely.
- 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.
- quit() # This will quit the program.
- #-=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=-
- def Menu():
- print(
- """
- +-----------|----------------------------------------|-----------+
- +-----------| Pizza Perfection: |-----------+
- +-----------| 1 - Register |-----------+
- +-----------| 2 - Start the system |-----------+
- +-----------| 3 - Quit |-----------+
- +-----------|----------------------------------------|-----------+
- """
- )
- program = input("Please enter a program number: ")
- if program == "1":
- Register_Username()
- elif program == "2":
- Login_Username()
- elif program == "3":
- Quit()
- else:
- print("This is not a valid program number.\nYou are now being returned to the Main Menu.")
- Menu()
- Menu()
- #-=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=-
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement