Done = False
while not Done:
print('S Start New Order')
print('E Edit Order')
print('P Print Bill')
print('R Receive Payment')
print('M Manager Report')
print('Q Quit')
print('-----------------')
Command = ''
while Command == '':
Command = input("Enter Choice> ")
Command = Command.strip().upper()
if Command[0] == 'S':
print('Start New Order:')
elif Command[0] == 'E':
print('Edit Order:')
elif Command[0] == 'P':
print('Print Bill:')
elif Command[0] == 'R':
print('Recieve Payment:')
elif Command[0] == 'M':
print('Manager Report:')
elif Command[0] == 'Q':
print('Quit:')
I want to make it so when someone types for instance "j" or "34", it jumps back to "Enter Choice" and does not display the whole menu all over again.
e.g.
while Command not in ['S', 'E','P', 'R', 'M', 'Q']:
Command = raw_input("Enter Choice> ")
Command = Command.strip().upper()
break
statement when user enter Q
option of Menu. or set value of Done = True
e.g.
elif Command[0] == 'Q':
print('Quit:')
break
OR
elif Command[0] == 'Q':
print('Quit:')
Done = True
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments