I am typing a python menu and i was wondering if there was a way to make the program return to a certain place. For instance:
print 'choose: '
a = raw_input (' apple[a], grape[g], quit[q] ')
if a=='a':
print 'apple'
elif a=='g':
print 'grape'
elif a=='q':
print 'quit'
print 'Are you sure?'
print 'yes[y], no[n]'
b=raw_input ('Choose: ')
if b=='y':
quit()
elif b=='n':
print 'returning to menu'
In the part where it is:
`b=raw_input ('Choose: ')
if b=='y':
quit()
elif b=='n':
print 'returning to menu'`
How would I return to the first apple\grape menu? Is there a way to do that so the user doesn't have to quit and instead return to the main menu?