def get_choice():
'''
Repeatedly prompts user to enter a number between 1 and 5, inclusive, until user enters a valid number, then returns that number, as an integer
'''
y = input("Please enter the number of the option you'd like: ")
while not (len(y) == 1 and '1' <= y <= '5'):
y = input("That choice is not available. Please enter a number between 1 and 5: ")
return int(y)
def main():
while True:
print("\nOptions\n"
"1. calculate_average()\n"
"2. letter_counter('brontasouruS')\n"
"3. Display 'Option 3' selected\n"
"4. Display 'Option 4' selected\n"
"5. Quit\n")
get_choice()
if get_choice() == 1:
calculate_average()
elif get_choice() == 2:
letter_counter('brontasouruS')
elif get_choice() == 3:
print("Option 3 selected")
elif get_choice() == 4:
print("Option 4 selected")
elif get_choice() == 5:
print("Bye bye!")
break
if __name__ == '__main__':
print(TITLE)
main()
This is my code, when I run it if I want to select option 3 I have to do it 3 times. Or if want to select option 5 I have to reenter it 5 times. desired selection be entered be entered several times?