CS-1004 Lecture Notes

A-Term 2016

Home Page for CS-1004

Below are the lecture notes, Python scripts, and additional materials for CS-1004, Introduction to Programming for Non-Majors for this term. Lecture notes will normally be posted shortly before or shortly after each class. Students are responsible for knowing and understanding all of the lectures and classroom activities, even those that they might miss — and even those the Professor might skip!

Chapter numbers refer to Python Programming: An Introduction to Computer Science, 2nd edition, by John Zelle.

Note 1: The PowerPoint versions of the lecture notes include dynamic displays. It is best to view them as “slide shows” from PowerPoint of by using the free PowerPoint viewer. The PDF versions are provided for your convenience, but they do not capture the dynamic flow of the lectures. If you have an older version of PowerPoint, a free conversion plug-in is available to read presentations in pptx format.

 

Note 2: The Python scripts in the Other Links column are (mostly) copies of the IDLE windows saved during class. Since they contain prompt characters and interleave lines of Python code with results from executing that code, they are not directly executable.

 

Date

Topic

Text
Chapters

Lecture Notes

Other
Links

Aug 25

Introduction

1

pptx

pdf

 

Aug 26

First Python program

1

pptx

pdf

 

Aug 29-30

Elements of a Python Program

1, 2

pptx

pdf

 Sep 1-2

More elements of a Python Program

2

pptx 

pdf

 

Sep 6 

Lists, for-loops, Pyplot

2.6
p. 345

pptx

pdf

 

 

For more information about Pyplot, see
http://matplotlib.org/users/pyplot_tutorial.html

Not in
text

 

 

 

 Sep 6-8

Miscellaneous topics

Various
Read Ch 3

pptx

 pdf

 

 Sep 8

Introduction to Objects

4

pptx

pdf

 

 Sep 8-9

Simple graphics package (download from
graphics.py, graphics.pdf )

4

 pptx

pdf

 

 Sep 9 & 12

Introduction to Debuggers and Debugging

Not in text

 pptx

pdf

 

 Sep 12

Strings, Lists, and Files

5

 pptx

pdf

 

 Sep 13

Decision Structures and Loops

7, 8

 pptx

pdf

 

 Sep 15

Monte Carlo Simulations

9

pptx 

pdf

 

 Sep 16

Notes on Homework #4

9.3

pptx

pdf

 

 Sep 19

More about Homework #4

2.1, 2.2,
6, 9.3

pptx

pdf

 

 Sep 20

Files, Format (again), Tuples, etc.

5, 6

pptx

pdf

 

 Sep 22

Homework #5 — counting words

5, 11

pptx 

pdf

 

 Sep 23, 26

Dictionaries

11.6

 pptx

pdf

 

 

Introduction to CSV files & Homework #6

Not in text

 

 

 

 

Objects (again), classes

10

 

 

 

 

More on Objects and Classes

10.6

 

 

 

 

Objects, Widgets, and Docstrings

10.5.3

 

 

 

 

Functions (revisited)

6

 

 

 

 

Consolidation and Review

Entire text

 

 

 

 

What is in a computer?