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.
10 March (Friday): Methods and Operations
There is a lot going on with classes in Python. There are all these mysterious methods that start with an underscore. Today we talk these mysterious methods. We show how to use these methods to create classes for mathematical types like fractions or complex numbers.
Reading: Chapter 17
6 March (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
3 March (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 6: Objects and Classes
27 February (Monday): Dictionaries and Objects
Today, we introduce the notion of objects. Objects are a new type of data. They require a new conceptual model for us to understand them.
24 February (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.4, 8.7, Chapter 10
Lab 5: Lists and Control Structures
17 February (Friday): Lists (and Sequences)
Reading: Sections 10.0-10.2 and 10.4-10.6
Lab 4: Assignment 1
13 February (Monday): 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
10 February (Friday): 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
Lab 3: Strings and Testing
6 February (Monday): 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.
3 February (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 2: Modules and Functions
30 January (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.4
27 January (Friday): Variables and Expressions
Reading: Chapters 1 and 2
Lab 1: Expressions and Assignments