Untitled

 avatar
unknown
plain_text
3 years ago
783 B
8
Indexable
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')
	print('[P] to exit the program!')

	# 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!")
	
Editor is loading...