IT 117: Intermediate Scripting
Class 14 - Midterm Review

Tips and Examples


Review


Microphone

Homework 7

I have posted homework 7 here.

It is NOT due this coming Sunday.

Instead it is due Sunday, March 24th.

This is to give you time to study for the midterm.

And to give me time to score it.

Midterm

The Midterm exam for this course will be held on Tuesday, March 19th.

That is the first Tuesday after the Spring Break.

The exam will be given in this room.

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.

There will be 15 of these questions worth 4 points each.

The other 40% of points will come from four questions that ask you to write a short segment of code.

Each of the code questions is worth 10 points each.

To study for the code questions you should know

A good way to study for the code questions is to review the Class Exercises and homework solutions.

Today's class will be a review session.

You will only be responsible for the material in the Class Notes for today's class on the exam.

You will find the Midterm review Class Notes here.

If for some reason you cannot take the exam on the date mentioned above you must contact me to make alternate arrangements.

The Midterm is given on paper.

I scan each exam paper and upload the scans to Gradescope.

I score the exam on Gradescope.

You will get an email from Gradescope with your score when I am done.

The Midterm is a closed book exam.

You are not allowed to any resource, other than what is in your head, while taking the exam.

Cheating on the exam will result in a score of 0 and will be reported to the Administration.

Remember your Oath of Honesty.

To prevent cheating, certain rules will be enforced during the exam.

Quiz 5

Let's look at the answers to Quiz 5

No Class Exercise or Class Quiz

Today is a review session.

There will no Class Exercise or Class Quiz today.

Questions

Are there any questions before I begin?

Tips and Examples

Studying for the Midterm with Flashcards

Review

Dictionaries

Dictionary Literals

Creating an Empty Dictionary

Getting Values from a Dictionary

Adding Elements to a Dictionary

Changing a Dictionary Value

Looping Through a Dictionary

When To Use a Dictionary

Lists versus Dictionaries

The in And not in Operators

Deleting Elements from A Dictionary

Getting the Number of Elements in a Dictionary

Attendance

Sets in Mathematics

Set Membership

Subsets and Supersets

Union of Sets

Intersection of Sets

Difference between Sets

Sets in Python

Creating a Set in Python

Set Literals

The Empty Set

Adding Elements to a Set

Removing Elements from a Set

The Size of a Set

When Are Sets Equal?

for Loops with Sets

Testing for Set Membership

Union of Sets in Python

Intersection of Sets in Python

Difference between Sets in Python

Subsets and Supersets in Python

min And max with Sets

The os Module

os.getcwd()

os.listdir(path)

os.chdir(path)

Running Unix Commands within Python

os.environ

The os.path Module

os.path.isfile(path) and os.path.isdir(path)

os.path.basename(path)

The sys Module

Getting Values from the Command Line

Leaving a Running Script

The Characters in Regular Expressions

Ordinary Characters in Regular Expressions

Meta-characters in Regular Expressions

The . Meta-character

The * Meta-character

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

Getting Strings from a Match

The ( ) Meta-characters

Repetition in Regular Expressions

Specifying a Range of Repeating Characters

Creating Custom Character Classes

Ranges of Characters in a Character Class

Greedy versus Non-greedy Matching