T-Th 9:05
T-Th 11:15
in Olin 155

CS 1110: Introduction to Computing Using Python

Spring 2018

Lecture Summaries

This page lists a summary of the activities of each week, in reverse chronological order. This is your go-to page for downloading in-class handouts and getting caught back up if you get behind. This page is updated dynamically all semester long, with new material added as we get there.

Week 10

Week 9

22 March (Thursday): More on recursion

     [Handout]      [Presentation]

Delving deeper into how to write a recursive function, what the call stack looks like, and a few mathematical examples.

20 March (Tuesday): Recursion

     [Handout]      [Presentation]

Today we talk about recursion!

Reading: Sections 5.8-5.10

Week 8

15 March (Thursday): Nested Lists, Tuples, and Dictionaries

     [Handout]      [Presentation]

Lists can contain lists, creating two-dimensional structures. A tuple is another built-in type: an immutable sequence of values. Dictionaries are collections of key-value pairs.

Reading: Sections 11.1-11.5, 12.1-12.3

13 March (Tuesday): NO CLASS - open office hours

No regular class. open office hours during lecture time instead.

Week 7

8 March (Thursday): Optional Coding Session

Prof Lee can do this in 8 lines. Mad split and join skillz! (...she did not write this)

Lab 6: Lists and Objects: Cards and Poker Hands


Because of the prelim, this lab is not due until the first ten minutes of the labs of Tue Mar 20/Wed Mar 21. But don't delay on it, since it will help with the prelim!
Practice with list operations, and doing some coding with lists of objects, in this case, Cards.

6 March (Tuesday): Iteration and For-Loops

     [Handout]      [Presentation]
writeup with more loop examples

Lists (and sequences) come with their own special control structure: the for-loop. In this lecture we see what for-loops can (and cannot) do to make more interesting programs.

Reading: Sections 4.2, 10.3

Week 6

1 March (Thursday): Lists (and Sequences)

     [Handout]      [Presentation]

A list is a sequence of values that can be of any type. A list of integers could hold a student's lab grades. A list of strings would be appropriate to maintain a shopping list for a trip to the grocery store. They are extremely useful! This lecture will show you how to create and manipulate lists, as well as how to draw them.

Reading: Sections 10.0-10.2, 10.4-10.6, 10.8-10.13

Lab 5: Objects; conditionals; oink!


Like the title says. The file time_script.py is optional; it is only provided in case you want to paste it into Python Tutor (see handout for more info).

27 February (Tuesday): Memory in Python

     [Handout]      [Presentation]

Throughout the past few weeks, we have seen several different ways of representing memory in Python. Today we put everything together, introducing global space, heap space, and the call stack (the collection of frames for all currently executing functions).

Week 5

22 February (Thursday): Conditionals and Control Flow

     [Handout]      [Presentation]

We talk about the difference between program structure and program flow. We introduce the conditional, which is our first program structure for controlling program flow. This will not be necessary for Assignment 1, but will be very important in later assignments.

Reading: Sections 5.1-5.7

Lab 4: There is no lab 4! (Feb break)

No new lab will be assigned for the Tues Feb 20/Wed Feb 21 date because of break. The Wednesday lab times and locations will be staffed and will serve as open office hours for anybody to drop in on, regardless of registered section. In contrast, for the Tuesday lab times and places, no staff members will be there (we will be on break, too.)

20 February (Tuesday): FEBRUARY BREAK

There is no class today.

Week 4

15 February (Thursday): Objects

     [Handout]      [Presentation]

We introduce the notion of objects, a new type of data. Objects allow us to go beyond writing functions to organize code and using built-in types to organize data. Objects use programmer-defined types to bundle both code and data into useful and meaningful combinations.

Reading: Chapter 15

Lab 3: Strings and Testing


Learning goals: (1) practice with string operations and string methods; (2) writing and using test cases; (3) debugging by examining variable contents via print statements.
This lab can be checked off two weeks from distribution because of the Feb break interruption.
Handout updated to fix typo on Tu Feb 13, 3:15pm. See orange text in handout.

13 February (Tuesday): Specifications and Testing

     [Handout]      [Presentation]

Writing functions takes a lot of practice and no one writes perfect code on the first try. That is why it is extremely important to test your functions and make sure they are working properly. We will also see why comments are more important than just notes to yourself.

Reading: Sections 4.9, 9.5

Week 3

8 February (Thursday): Strings

     [Handout]      [Presentation]

Python really shows off its power when working with text. Today we go into depth about the str type, which is how Python represents text. We show how to cut up text and paste it back together. These techniques will be very important for the first assignment.

Reading: Sections 8.1, 8.2, 8.4, 8.5, first paragraph of 8.9

Lab 2: Functions and Modules --- Some "Hi"-lights


Learning goals: Practice with: (1) the Command Shell; (2) using and editing functions defined in an external file; (3) Komodo Edit; (4) running Python scripts on the command line; (5) using one function as a helper for another.

6 February (Tuesday): Defining Functions

     [Handout]      [Presentation]

We learn how to create our own functions and the important difference between a function call and a function definition.

Reading: Sections 3.4-3.11

Week 2

1 February (Thursday): Functions and Modules

     [Handout]      [Presentation]

We introduce the concept of a module and show how they provide Python with extra (optional) functionality. We show how to use the many modules built into Python, and how to make our own modules.

Reading: Sections 3.1-3.3

Lab 1: Expressions and Assignments


Learning goals: (1) get hands-on experience using Python in interactive mode via the command shell; (2) get hands-on experience with Python types, expressions, and variables.

30 January (Tuesday): Variables and Assignments

     [Handout]      [Presentation]

We introduce the notion of a variable and how an assignment statement works.
We will use the iClickers for the first time today.

Reading: Sections 2.1-2.3, 2.5

Week 1

25 January (Thursday): Types and Expressions

     [Handout]      [Presentation]

We give an overview of the course and its expectations. We show you how to get started with Python. In particular, we introduce types and expressions, which is the bare minimum that you need to do something "useful" in Python.

Reading: Chapter 1, Section 2.6

Course Material by: E. Andersen, A. Bracy, D. Gries, L. Lee, S. Marschner, C. Van Loan, W. White