I am trying to make the main menu text keep repeating until the user chooses 5 and then the program closes but I don't know how to make it keep repeating. I tried to use a while loop which didn't work and started spamming the main menu. So here is the code all I need is for you to explain how to make the main menu repeat and the choice repeat until the user picks option five (exit).
print('''------------
Main Menu
------------''')
one='1 - show all contacts'
two='2 - add a new contact'
three='3 - find contact'
four='4 - Delete contact'
five='5 - Quit'
print(one)
print(two)
print(three)
print(four)
print(five)
choice=input('enter your chouse : ')
if choice == '1':
print('this is your list : ')
elif choice == '2':
print('add your contact : ')
elif choice == '3':
print('type in a contact you would like to find')
elif choice == '4':
print('type in a contact you would like to delete')
elif choice == '5':
print('quitting....')
quit()
while choice != '5' :
print('''------------
Main Menu
------------''')
one='1 - show all contacts'
two='2 - add a new contact'
three='3 - find contact'
four='4 - Delete contact'
five='5 - Quit'
print(one)
print(two)
print(three)
print(four)
print(five)
choice=input('enter your chouse : ')
if choice == '1':
print('this is your list : ')
elif choice == '2':
print('add your contact : ')
elif choice == '3':
print('type in a contact you would like to find')
elif choice == '4':
print('type in a contact you would like to delete')
elif choice == '5':
print('quitting....')
quit()
I tried to use a while loop which didn't work and started spamming the main menu.