Untitled
unknown
plain_text
2 years ago
745 B
1
Indexable
Never
loop = True # WE SET A VARIABLE CALLED LOOP AND ASSIGN IT AS TRUE while loop: # KEEP LOOPING THIS FUNCTION WHILE LOOP IS TRUE # PRINT THE MENU print('Choose difficulty:') print('[E]asy') print('[M]edium') print('[H]ard') # ASK FOR USER INPUT AND ASSIGN TO VAR CHOICE choice = input("Enter choice: ") if choice.lower() == 'e': print("You have chosen easy mode.") elif choice.lower() == 'm': print("You have chosen regular mode.") elife choise.lower() == 'h': print("You have chosen hard mode.") elif choice.lower() == 'p': print("Goodbye!") loop = False # ASSIGN LOOP TO BE FALSE IF YOU WANT TO EXIT THE LOOP AND STOP THE PROGRAM else: print("Invalid option, please try again!")