While Loop

Here's a Binky while loop example

def loop_demo(binky):
    'go forward so long as way is clear, painting squares blue'
    while binky.front_clear():
        binky.move()
        binky.paint('blue')

Go here first: Loop Demo

Syntax 4 parts: while, test, colon, body lines

while test:
  'body' code inside the while
  indented

While Loop Operation

binky.front_clear()


Binky Exercises

These will be part of hw1 soon. Get run-all All Correct for each (see myprojects at upper-right)

1. Arms2

2. Bluegreen

3. Diagonal