IT 117: Intermediate Scripting
Class 28

Today's Topics


Final Exam

The final exam will be given on Thursday, December 21st from 3:00 - 6:00.

The exam will be given in Healey 4-031.

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 today's class will be a review session.

You will only be responsible for the material in the Class Notes for today's class and the review for the Mid-term, which you will find here.

Although the time alloted for the exam is 3 hours, I would expect that most of you would not need that much time.

You will not be able to leave the room until you turn in your exam paper so you should visit the restroom before you take the test.

The final is a closed book exam.


The Characters in Regular Expressions

Ordinary Characters in Regular Expressions

Using Regular Expressions to Find a Match

Pattern Objects

A Test Function for Regular Expressions

Meta-characters in Regular Expressions

The . Meta-character

The * Meta-character

Match Starts from Beginning of String

The + Meta-character

The ? Meta-character

The \ Meta-character

Character Classes

\d and \D Character Classes

The \w and \W Character Classes

The \s and \S Character Classes

Real World Regular Expressions

Getting Strings from a Match

The ( ) Meta-characters

A New Regular Expression Testing Script

Repetition in Regular Expressions

Specifying a Range of Repeating Characters

Creating Custom Character Classes

Ranges of Characters in a Character Class

The ^ Meta-Character

The | Meta-Character



Defining a Class

The Constructor Is Special

Creating An Object from A Class

The self Variable

Data Hiding

Hiding Methods

The __str__ Method

Accessor and Mutator Methods

Magic Methods

Magic Methods and Boolean Operators

Type Conversion Magic Methods

Reusing Classes


Principles of Inheritance

Creating Superclasses

Creating a Subclass

Creating a Constructor for a Subclass

The super Function

Functions Calling Functions

Recursive Functions

Writing Recursive Functions

Calculating the Factorial of a Number

Calculating Fibonacci Numbers

Replacing Recursion with a Loop

Direct versus Indirect Recursion