How to make program go back to the "menu"?

Elsa
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.

Vivek Sable
  1. We have to check in entered value.

e.g.

while Command not in ['S', 'E','P', 'R', 'M', 'Q']:
    Command = raw_input("Enter Choice> ")
    Command = Command.strip().upper()
  1. Use 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.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

How to make program go back to the "menu"?

From Dev

How to make program go back to the top of the code instead of closing

From Dev

How to make this program go back to prompt until the user exits

From Dev

How would I make a program go back to the start.

From Dev

How do I make menu link go back to index page and slide to specific height?

From Dev

How to go back from switch menu

From Dev

Swift - How to program a button to go to the mainScene, without segues going back?

From Dev

UIBarButton does not go back to Menu

From Dev

How to make the program revert back to original text without retyping it

From Dev

How to make an animation go back to origin point using Expression Blend

From Dev

How to make Sudoku solver with backtracking algorithm go back?

From Dev

How to make a private sub go back to sub main()

From Dev

How to make an element go back to being noneditable in JavaScript?

From Dev

Program Back button to go back where it was called self.presentViewController

From Dev

How to get back Applications menu?

From Dev

How to get back Applications menu?

From Dev

trying to make a menu for a program and run a specific function

From Dev

How can I make the second instance of my program pass control back to the first instance?

From Dev

Make back button go to the previous view programmatically

From Dev

Make back button go to the previous view programmatically

From Dev

how to jump back to the top of a program

From Dev

How to reloop program back to beginning

From Dev

How to make a tab menu

From Dev

How to make a tab menu

From Dev

How to make scroll menu?

From Dev

How to make dropdown menu

From Dev

How to make element instantly go back to initial position after CSS animation end?

From Dev

How to make left push of scrollwheel go back a page in Firefox (Logitech M-UAG120 mouse)

From Dev

How to I make specific section function run and go back to the main loop?

Related Related

  1. 1

    How to make program go back to the "menu"?

  2. 2

    How to make program go back to the top of the code instead of closing

  3. 3

    How to make this program go back to prompt until the user exits

  4. 4

    How would I make a program go back to the start.

  5. 5

    How do I make menu link go back to index page and slide to specific height?

  6. 6

    How to go back from switch menu

  7. 7

    Swift - How to program a button to go to the mainScene, without segues going back?

  8. 8

    UIBarButton does not go back to Menu

  9. 9

    How to make the program revert back to original text without retyping it

  10. 10

    How to make an animation go back to origin point using Expression Blend

  11. 11

    How to make Sudoku solver with backtracking algorithm go back?

  12. 12

    How to make a private sub go back to sub main()

  13. 13

    How to make an element go back to being noneditable in JavaScript?

  14. 14

    Program Back button to go back where it was called self.presentViewController

  15. 15

    How to get back Applications menu?

  16. 16

    How to get back Applications menu?

  17. 17

    trying to make a menu for a program and run a specific function

  18. 18

    How can I make the second instance of my program pass control back to the first instance?

  19. 19

    Make back button go to the previous view programmatically

  20. 20

    Make back button go to the previous view programmatically

  21. 21

    how to jump back to the top of a program

  22. 22

    How to reloop program back to beginning

  23. 23

    How to make a tab menu

  24. 24

    How to make a tab menu

  25. 25

    How to make scroll menu?

  26. 26

    How to make dropdown menu

  27. 27

    How to make element instantly go back to initial position after CSS animation end?

  28. 28

    How to make left push of scrollwheel go back a page in Firefox (Logitech M-UAG120 mouse)

  29. 29

    How to I make specific section function run and go back to the main loop?

HotTag

Archive