About 159,000 results
Open links in new tab
  1. 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:

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

  3. Why there is no do while loop in python - Stack Overflow

    There is no do...while loop because there is no nice way to define one that fits in the statement: indented block pattern used by every other Python compound statement.

  4. Why does python use 'else' after for and while loops?

    Feb 13, 2016 · Almost 10 years after this question has been asked and after programming with Python for 3 years, this is the first time I've seen the "for-else", "while-else" construct. I hope its …

  5. python - How to stop one or multiple for loop (s) - Stack Overflow

    128 Use break and continue to do this. Breaking nested loops can be done in Python using the following:

  6. for loop in Python - Stack Overflow

    60 You should also know that in Python, iterating over integer indices is bad style, and also slower than the alternative. If you just want to look at each of the items in a list or dict, loop directly …

  7. python - Get loop count inside a for-loop - Stack Overflow

    This for loop iterates over all elements in a list: for item in my_list: print item Is there a way to know within the loop how many times I've been looping so far? For instance, I want to take a

  8. python - How do you create different variable names while in a …

    How do you create different variable names while in a loop? [duplicate] Asked 14 years, 6 months ago Modified 5 years, 5 months ago Viewed 699k times

  9. python - How do I iterate through two lists in parallel ... - Stack ...

    Building on the answer by @unutbu, I have compared the iteration performance of two identical lists when using Python 3.6's zip() functions, Python's enumerate() function, using a manual …

  10. Repeat-until or equivalent loop in Python - Stack Overflow

    Dec 15, 2017 · I am a beginner in Python programming. I am trying to work on this algorithm that finds convex hull using Graham's scan method. However, in the pseudocode, there is a repeat …