Skip to content
murmot

Results for “python while loop example program site:wiki.python.org”

  • wiki.python.org

    While loops - Python Software Foundation Wiki Server

    While loops Usage in Python When do I use them? While loops, like the ForLoop, are used for repeating sections of code - but unlike a for loop, the while loop will not run n times, but until a defined condition is no longer met. If the condition is initially false, the loop body will not be executed at all. As the for loop in Python is so powerful, while is rarely used, except in cases where a ...

  • wiki.python.org

    Simple Programs - Python Wiki

    keys()): if hour < activity_time: print (activities[activity_time]) break else: print ('Unknown, AFK or sleeping!') 11 lines: Triple-quoted strings, while loop.

  • wiki.python.org

    For Loop - Python Wiki

    The Python for statement iterates over the members of a sequence in order, executing the block each time. Contrast the for statement with the ‘’while’’ loop, used when a condition needs to be checked each iteration or to repeat a block of code forever. For example: For loop from 0 to 2, therefore running 3 times.

  • wiki.python.org

    For Loop - Python Wiki

    There are two ways to create loops in Python: with the for-loop and the while-loop. When do I use for loops¶. for loops are used when you have a block of code ...

  • wiki.python.org

    Getting Started - Python Wiki

    This section collects beginner-friendly guides, example programs ... Learn Python – learning Python through XML, XSLT, and other practical code samples. While ...

  • wiki.python.org

    Problemsets - Python Wiki

    Simple Programs · Simple Programs Chinese · While Loop · GUI Programming · Guides and How-Tos · Internationalization · Python Implementations · Infrastructure ...

  • wiki.python.org

    Beginners Guide / Examples - Python Wiki

    Python Examples and Sample Code ¶ When you’re learning, small examples can be very helpful. The Python Standard Library (archived copy), an electronically published book by Fredrik Lundh, examines most of the modules in Python’s standard library, describing what the module does and giving a short example of its use. Note that this book is now relatively old and so misses a lot of the ...

  • wiki.python.org

    Programmers - Python Wiki

    Simple Programs · Simple Programs Chinese · While Loop · GUI Programming · Guides and How-Tos · Internationalization · Python Implementations · Infrastructure ...

  • wiki.python.org

    GUI Programming - Python Wiki

    GTK¶. PyWebkitGtk – Python bindings for WebKit on GTK, enabling web-based desktop UIs. Back to top. Previous. While Loop · Next. Portingpythonto Py3k. 2026, ...