M, F 2:30-3:20
CS 1133: Short Course in Python
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.
If you want to see what future lectures in this class will be, you should look at the syllabus page.
6 October (Friday): Using Classes Effectively
Programming with classes can be very confusing if you have never used them before. For the last class, we will not be introducing (much new Python). Instead we will talk about how you design classes, and what classes should be used for. In particular, we show how to use classes to create mathematical types like fractions or complex numbers.
Reading: Chapter 17
Lab 6: Objects and Classes
2 October (Monday): Classes
Up until now, if we wanted to use objects, we had to import a module that provided them for us. Today we finally learn how to create our own classes. Not only can we make our own class types now, but we can even add them to the Python visualizer.
Reading: Chapters 15, 16
29 September (Friday): Memory in Python
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 latter is the collection of frames for all currently executing functions.
Lab 5: Lists and Control Structures
25 September (Monday): Dictionaries and Objects
Today, we introduce the two new data type: dictionaries and objects. While these types behave very differently, they are actually very similar when we look at their memory representation. Objects will be a major part of Assignment 2.
Reading: Chapter 11
22 September (Friday): For-Loops
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 8.3, 8.7, Chapter 10
Lab 4: Assignment 1
18 September (Monday): Lists (and Sequences)
Reading: Sections 10.1-10.2 and 10.4-10.6
15 September (Friday): Conditionals and Control Flow
Today we talk about the difference between program structure and program flow. We also 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 3: Strings and Testing
11 September (Monday): Specifications and Testing
We now know how to write some complex functions. However, writing functions takes a lot of practice and you are likely make mistakes along the way. That is why it is extremely important to test your functions and make sure they are working properly. As part of testing, we will also see why comments are more important that just notes to yourself.
Reading: Docstrings in Python
8 September (Friday): Strings
Python really shows off its power when working with text. Today we go into depth about the string type, which is how Python represents text. We show how to cut up text and paste it back together. The techniques that we learn will be very important for the first assignment.
Reading: Sections 8.1-8.2, 8.5, 8.8
Lab 2: Modules and Functions
1 September (Friday): Defining Functions
Now that we know how to use functions, we can learn how to create our own functions. As part of this, we will learn the important difference between a function call and a function definition.
Reading: Chapter 3
Lab 1: Expressions and Assignments
28 August (Monday): Functions and Modules
Today 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
25 August (Friday): Variables and Expressions
Reading: Chapters 1 and 2