IT 116: Introduction to Scripting
Class 8

Today's Topics

Tips and Examples


New Material

Reading Assignment

You should read Chapter 3, Decision Structures and Boolean Logic, from our textbook, Starting Out with Python, before next weeks's class.

Homework 3

I have posted homework 3 here.

It is due this coming Sunday at 11:59 PM.

Tips and Examples

Misleading Error Messages


Control Structures

if Statements

Boolean Expression

Relational Operators

Precedence of Relational Operators

if-else Statements

Indentation in the if-else Statement

Comparing Strings

Nested if Statements

Testing a Series of Conditions

if-elif-else Statements

New Material

Logical Operators

Short-Circuit Evaluation

Precedence of Logical Operators

Checking Numeric Ranges with Logical Operators

Boolean Variables

Keep Your Code Short


while Loops

Testing Variables in While Loops

Infinite Loops

Data Validation Loops


Class Quiz