IT 116: Introduction to Scripting
Class 23

Today's Topics

Tips and Examples


Review


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.

Announcement

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: ./ex21.py: /usr/bin/python3^M: bad interpreter: No such file or directory
This problem can be fixed using the Linux command dos2unix
dos2unix ex21.py

Problems with the Hashbang Line

Review

Sequences

Lists

The list Function

The Repetition Operator

Empty Lists

Using a for Loop with Lists

Indexing

The len Function

Changing Elements Using Indexes

Concatenating Lists

New Material

Slices

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

Attendance

Class Quiz