# Standard multi choice question template def multiChoiceQuestion(options: list): while True: print("\nEnter the number of your choice - ") for x in range(len(options)): print(str((x + 1)) + ". " + options[x]) print("\n") try: answer = int(input()) except ValueError: print("Doesn't seem like a number! Try again!") continue if answer < 1 or answer > len(options): print("That option does not exist! Try again!") continue return answer
I created a template to ask a multi choice question in python. The loop will never reach it's end, since there is always a continue or a return statement. Is the
while True condition appropriate for it?