Title: Layout 2
Course: CPS 120: Introduction to Computer Science ~ Master (Aug/2015) OLD > Section: Learning Units

✓ Layout 2 syntax – continually execute the first block until a condition is false, and then execute the second block.

while <condition>:
<first-block>
else:
<second-block>

✓ Layout 2 example:

temp = 71
while temp > 41:
print ("temp is now", temp)
temp = temp - 1
else
print("We went from summer to fall!")