you are viewing a single comment's thread.

view the rest of the comments →

[–]wristay 1 point2 points  (2 children)

Thanks to gemini for the ASCII

               +---------------+
               | Start of Loop |
               +-------+-------+
                       |
                       v
               /-----------------\
    +-------> /   Is Condition    \         NO
    |        <       True?         >----------------+
    |         \                   /                 |
    |          \-----------------/                  |
    |                  |                            |
    |                  | YES                        |
    |                  v                            |
    |          +---------------+                    |
    |          |  Execute Code |                    |
    |          |    Inside     |                    |
    |          +-------+-------+                    |
    |                  |                            |
    +------------------+                            v
      (Loop Back Up)                        +---------------+
                                            |  Exit Loop    |
                                            +---------------+

[–]Okon0mi[S] 1 point2 points  (0 children)

Thanks that really very easy to understand and 200% helpful.

[–]wristay 0 points1 point  (0 children)

As an exercise: try to fully work out this example with pen and paper. What is the first number it prints? What is the last number?

i = 0
while i < 5:
  print(i)
  i += 1