IT 116: Introduction to Scripting
Class 9

Today's Topics

Tips and Examples


New Material

Reading Assignment

You should read Chapter 4, Repetition Structures, from our textbook, Starting Out with Python, before next week's class.

Homework 4

I have posted homework 4 here.

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


The mid-term exam will be given on Monday, July 2nd.

It will consist of questions like those on the quizzes along with questions asking you to write short segments of Python code.

60% of the points on this exam will consist of questions from the Ungraded Class Quizzes.

The last class before the exam, Thursday, June 28th, will be a review session.

You will only be responsible for the material in the Class Notes for that class on the exam.

The Mid-term is a closed book exam.

Quiz 1

I have posted the answers to Quiz 1 here.

Tips and Examples

Converting Results to Integer

Indent All Statements in a Code Block

Use Spaces before and after =


Logical Operators

Short-Circuit Evaluation

Precedence of Logical Operators

Checking Numeric Ranges with Logical Operators

Boolean Variables


while Loops

Testing Variables in While Loops

Infinite Loops

Data Validation Loops

New Material

Compound Statements

The for Loop in Python

for Loops in Other Languages

for Loops

The range Function

Setting the First and Last Values with range

Changing the Increment with range

Reversing the range Values

Why Does Python Have the range function?

for Loop that Don't Use the Loop Value


Graded Quiz