About 50 results
Open links in new tab
  1. What's the exact distinction between the FOR loop and the WHILE Loop

    Dec 12, 2022 · What's the exact distinction between the FOR loop and the WHILE Loop Ask Question Asked 3 years, 3 months ago Modified 3 years, 3 months ago

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

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

  3. windows - While loop in batch - Stack Overflow

    May 14, 2015 · For this, I determined how to use a couple methods to break the FOR Loop prematurely effectively turning it into a " DO WHILE " or " DO UNTIL " Loop, which is otherwise sorely lacking in …

  4. Difference between "while" loop and "do while" loop

    Sep 2, 2010 · The do while loop executes the content of the loop once before checking the condition of the while. Whereas a while loop will check the condition first before executing the content. In this …

  5. Why use a for loop instead of a while loop? - Stack Overflow

    Oct 7, 2010 · Possible Duplicates: Iterate with for loop or while loop? Loops in C - for() or while() - which is BEST? When should one use a for loop instead of a while loop? I think the following loops ...

  6. python - When Does a While Loop Break - Stack Overflow

    Jan 9, 2013 · A while loop doesn't automatically exit in mid-loop as soon as its condition is no longer true; it just checks the condition at the start of each loop. If you want to get out early, you need to …

  7. Syntax for a single-line while loop in Bash - Stack Overflow

    May 19, 2017 · 1695 while true; do foo; sleep 2; done By the way, if you type it as a multiline (as you are showing) at the command prompt and then call the history with arrow up, you will get it on a single …

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

    Jan 30, 2013 · 8 Don't use while True and break statements. It's bad programming. Imagine you come to debug someone else's code and you see a while True on line 1 and then have to trawl your way …

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

    I am trying to plot some data from a camera in real time using OpenCV. However, the real-time plotting (using matplotlib) doesn't seem to be working. I've isolated the problem into this simple exa...

  10. Else clause on Python while statement - Stack Overflow

    Jul 21, 2010 · I always tell people who are struggling to remember the usage, "If you're breaking out of the loop, you have an opportunity to do something right before your break statement. If you're …