About 32,100,000 results
Open links in new tab
  1. python - How to return to the main menu in a loop? - Stack Overflow

    Jul 14, 2024 · I'm wondering if this is the right approach to looping back to the main menu in python. After selecting a choice and completing a task, the script needs to return back to the …

  2. break, continue, and return :: Learn Python by Nina Zakharenko

    Using break The break statement will completely break out of the current loop, meaning it won’t run any more of the statements contained inside of it. >>> names = ["Rose", "Max", "Nina", …

  3. menu while loop - Python Forum

    Dec 21, 2021 · In this code we have one operate_menu function that accepts a tuple of two lists. One list is the options to display for the menu and the other is a list of the command …

  4. How do i get the options to loop back to the menu : …

    player_menu = print(...) To just player_menu = 'MENU\na - Add player\nd - Remove player\nu - Update player rating\nr - Output players above a rating\no - Output roster\nq - Quit'

  5. loops - looping back to a main menu in python - Stack Overflow

    Mar 10, 2014 · You could put all of the above code inside a while True: loop, and break out of the loop when you don't want to return to the main menu. while True: # your code here …

  6. python - looping back to specific point in code - Stack Overflow

    Dec 8, 2014 · You can bring the raw_input step into a while loop and only exit if a valid response was received. I added a couple of comments to explain what's going on. while True: # repeat …

  7. python - How to make program go back to the top of the code …

    You can give it a boolean condition (boolean values are either True or False in Python), and the loop will execute repeatedly until that condition becomes false. If you want to loop forever, all …

  8. python - When returning a while loop back to the menu. the …

    Mar 25, 2022 · I have addded menu() to take the user back to the main menu, where they are able to select an option again. I have tried following up menu() with my prompt question option …

  9. How can I make my program return to the beginning in Python?

    while loop == 4: This means the loop will be executed as long as the value of the variable 'loop' remains 4. But since you assign 2 to loop, the condition is not satisfied, and control goes out of …

  10. python - Moving back an iteration in a for loop - Stack Overflow

    Jan 17, 2013 · In Python it's possible to set up a two-way exchange between an iterator (what comes after in in a for..in loop) and its consumer (code inside the loop). To achieve this, you …

  11. Some results have been removed
Refresh