About 21,700,000 results
Open links in new tab
  1. Get User Input in Loop using Python - GeeksforGeeks

    Apr 24, 2025 · When it comes to user input, these loops can be used to prompt the user for input and process the input based on certain conditions. In this article, we will explore how to use for …

  2. loops - Python: How to keep repeating a program until a specific input

    There are two ways to do this. First is like this: inp = raw_input() # Get the input. if inp == "": # If it is a blank line... break # ...break the loop. The second is like this: inp = raw_input() # Get the …

  3. Using a For or While Loop to take user input in Python

    Apr 9, 2024 · To take user input in a while loop: Use a while loop to iterate until a condition is met. Use the input() function to take user input. If the condition is met, break out of the while loop.

  4. Using For and While Loops for User Input in Python - Stack Abuse

    In this Byte, we've explored how to use for and while loops in Python to take in user input. We've seen how these loops allow us to repeat a block of code until a certain condition is met, which …

  5. How to Take User Input with Loops in Python - Tutorial Reference

    This guide explores how to take user input within loops in Python, using both for and while loops. We'll cover how to: Collect a fixed number of inputs. Collect input until a condition is met. …

  6. How to Get User Input in Python while Loop - Delft Stack

    Mar 11, 2025 · Learn how to get user input in Python while loops effectively. This guide covers using the input () function to gather data until a condition is met, implementing input validation, …

  7. Mastering User Input with For and While Loops in Python

    In this article, we will discuss how to use both for loops and while loops in Python to handle user input effectively. We’ll cover string inputs, integer inputs, list comprehension, and numeric …

  8. Python while loop user input | Example code - EyeHunts

    Dec 7, 2021 · Just need to take input from the user and evaluate those values in the while loop expression condition. A simple example code takes input from the user and adds values into a …

  9. How to Take Multiple Inputs Using Loop in Python

    Feb 22, 2024 · Taking multiple inputs in Python using a for loop can be achieved through various methods, each offering its own advantages. Whether you prefer using a list, list …

  10. function - Python - Looping an Input - Stack Overflow

    Mar 24, 2012 · Use a While Loop - if choice == '1': print("You chose 1") elif choice == '2': print("You chose 2") elif choice == '3': print("You chose 3") else: print("That is not a valid …

  11. Some results have been removed
Refresh