IT 116: Introduction to Scripting
Class 23

Today's Topics

Tips and Examples


New Material

Reading Assignment

You should read Chapter 8, More About Strings, from our textbook, Starting Out with Python, before next week's class.

Homework 11

I have posted homework 11 here.

It is not due this Sunday.

Instead it is due Sunday, December 3rd, at 11:59 PM.

Quiz 8

The answers to Quiz 8 are posted here.

Let's take a look.


There will be no graded quiz this week.

But there will be one the following week covering the material in the previous 3 Class Quizzes.

Tips and Examples

A Problem with Non-printing Characters

Sometimes students have run into a problem when trying to run their scripts, without calling python3 at the command line.

When they try they get an error message like this

-bash: ./ /usr/bin/python3^M: bad interpreter: No such file or directory
This problem can be fixed using the Linux command dos2unix

Problems with the Hashbang Line




The list Function

The Repetition Operator

Empty Lists

Using a for Loop with Lists


The len Function

Changing Elements Using Indexes

Concatenating Lists

New Material


Leaving Out Indexes in a Slice

Skipping Elements in a Slice

The in Operator

List Methods

The append Method

The index Method

The insert Method

The remove Method

The sort Method

The reverse Method

The del Statement

The min and max Functions


Class Quiz