Learning objectives for chapter 6
Learn to use the if-statement to skip over statements in case conditions are not met.
Learn to use if-else logic to select one set of statements or another depending on conditions being met.
Learn to combine comparisons with and-logic and or-logic, using the and and or operators.
Learn how to implement validation loops to gather valid console input.
Learn how to repeat code using a while-true-if-break loop.
  Learning objective(s) addressed
  12345
Exercises Right-click (or control-click on a Mac) the title to save its PDF to your system.  
6.1 Three-Question Quiz, v.1.0 PDF X    
6.2 Input Validation PDF XX X 
6.3 Making Change, v.3.0 PDF X    
6.4 Temperature Conversion, v.2.0 PDF     X
6.5 Coin Toss, v.1.0 PDF XX   
6.6 Over-Under Guessing Game, v.1.0 PDF X    
6.7 Over-Under Guessing Game, v.2.0 PDF X   X
6.8 The Game Of War, v.1.0 PDF X    

 
Samples Right-click (or control-click on a Mac) the title to save its PDF to your system.  
6.1 About For-loops PDF XX   

 
Videos  
6.1 Click HERE for a YouTube-like video that shows how to develop code and algorithms with if-logic. It's 19 minutes long, with most of it covering the development of an algorithm to solve a problem. The code development is in Java (on a Mac), but it's use of the if-statement and else-if logic is exactly the same as it would be in Python, so it's suitable for students of any computer language.  XX  

Code from the chapter in order of their appearance in the text
oneToTen.py Rumpelstiltskin.py gradeB.py passingGrade.py passNoPass.py
The 2-Space Indented Code Block passingGradeL.py passingGradeIB.py tempConvert.py  
quiz.py thereYet.py crossTheRoad.py Without Validation  
With A Validation Loop Another Validation Loop Finding The Maximum Or Minimum Value Sorting Values Lo-to-Hi  

Chapter 1 | 2 | 3 | 4 | 5 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15