About 50 results
Open links in new tab
  1. When to use "while" or "for" in Python - Stack Overflow

    May 28, 2009 · When I should use a while loop or a for loop in Python? It looks like people prefer using a for loop (for brevity?). Is there any specific situation which I should use one or the other? Is it a mat...

  2. python - Understanding while loop - Stack Overflow

    Dec 23, 2015 · The while loop is a statement that allows code to be run on a given boolean value. You can find more information here, and I've included the example given in the article below - converted …

  3. python - How to emulate a do-while loop? - Stack Overflow

    1125 I need to emulate a do-while loop in a Python program. Unfortunately, the following straightforward code does not work:

  4. loops - Is there a "do ... until" in Python? - Stack Overflow

    Jun 21, 2015 · A do-while (although it should be called until) is my greatest wish for Python.

  5. How to break out of while loop in Python? - Stack Overflow

    Jan 30, 2013 · The condition that causes a while loop to stop iterating should always be clear from the while loop line of code itself without having to look elsewhere. Phil has the "correct" solution, as it …

  6. How do I plot in real-time in a while loop? - Stack Overflow

    42 None of the methods worked for me. But I have found this Real time matplotlib plot is not working while still in a loop All you need is to add

  7. Using or in a while loop (Python) - Stack Overflow

    print("Succes") My code never goes out of the while loop even if the variable is assigned 1 or 2 or 3. Am I missing something here or doing something wrong? I never read any documentation about Python …

  8. Python While Loop, the and (&) operator is not working

    May 26, 2012 · The answer I am getting is 27, which tells me once it reaches 27 and can divide 54/27 evenly, it stops. Any thoughts on how to use an and operator in a while loop in python? Thanks!

  9. While loop with if/else statement in Python - Stack Overflow

    Apr 25, 2016 · So I am still in the process of learning Python and I am having difficultly with while loops. I have a sample of code below that includes while loop and if and else statements.

  10. Python while loops - Stack Overflow

    Dec 28, 2012 · I have this code in python 3,to check for errors on input but i need to determine that the input is an integer and if not to print the error message. can anyone help me to figure out the code in …