9-26 & 9-27

today: while loops and greater than/less than variables

Find your old code where we used if/else to see if it’s dark outside.  Can’t find it? Enter the code below into Python and run it:

Quick tip – to indent or dedent (remove an indent) use command key and press the [ or ] key.  Try it.  Really.

How do we get this code to repeat and ask use if we want to check the sun again?  That’s the while loop.  Python is uses a while loop to check if a condition exists or does not exist.

part II: Greater/than if/else

Now try the Thermostat Program

click here to turn in your assignments after you post them to trinket.io

 

Leave a Reply

Your email address will not be published. Required fields are marked *