IT 117: Intermediate Scripting
Class 4

Today's Topics

Python Review

Reading Assignment

In Chapter 9, Dictionaries and Sets, from our textbook, Starting Out with Python, you should read section 9.1, Dictionaries, before next Tuesday's class.

Homework 2

I have posted homework 2 here.

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

Review

Running a Script Using python3

Running a Script Without python3

Records

Errors

Runtime Errors

Exceptions

Catching Exceptions

Different Exception Types

Common Exception Types

Defensive Programming

Handling More Than One Type of Exception

Exception Objects

The else Clause

Sequences

Lists

The list Function

Sequence Operators

Empty Lists

The len Function

Using a for Loop with Lists

Indexing

Changing Elements Using Indexes

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

Problems with Copying Objects

Copying Lists

Functions That Return Lists

Functions That Work with Lists

Functions That Change Lists

Tuples

Why Use Tuples?

Accessing Characters in a String

Negative Numbers as Indexes

Using a for Loop with Strings

Strings Are Immutable

Substrings

Testing Strings with in and not in

strip()

Splitting a String

Attendance

Class Quiz