约 50 个结果
在新选项卡中打开链接
  1. 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:

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

    2013年1月30日 · 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 …

  3. python - 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

  4. Python : How does `while` loop work in python when reading lines?

    2016年6月16日 · How does while loop work in python when reading lines? state=True #can be set to {anyInterger,True,False} while state: #do a task #if task done change state to exit loop so depending …

  5. python - Why doesn't the while loop stop when the condition becomes ...

    2022年12月14日 · A while loop does not terminate when the condition becomes false. It terminates when it evaluates the condition and the condition is found to be false. That evaluation doesn't …

  6. How to properly use "while not" loops in python? - Stack Overflow

    2020年12月14日 · I am learning python since a couple of days now. I did understand the concept of while and for loops in general. However, at the moment I am trying to understand the code written for …

  7. Is the continue statement necessary in a while loop?

    That's because when python sees continue, it skips the rest of the while suite and starts over from the top. You won't see 'horse' or 'cow' either because when 'horse' is seen, we encounter the break …

  8. python - How can I break out of multiple loops? - Stack Overflow

    Another downside is that it doesn't work with a while loop. I originally wanted to post this answer on Python - `break` out of all loops but unfortunately that's closed as a duplicate of this one

  9. 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 …

  10. python - How do I count the amount of iterations in a while loop ...

    2020年8月25日 · How do I count the amount of iterations in a while loop? [duplicate] Ask Question Asked 5 years, 7 months ago Modified 5 years, 7 months ago