Lecture 1: Course Overview & Introduction to Python and cs1graphics
.
Slides
PDF files of the lecture slides handouts. We'll provide printed copies in lecture for you to make notes on.
Readings
- Think Python, Ch. 1: The Way of the program
-
Think Python, Ch. 2: Variables, expressions and statements
The above links are suggested readings that can be completed during the week. These readings are important because they explain the terminology used in our lectures and labs. They also talk about common practices such as debugging, how to name variables, or the difference between interactive and script mode in Python. If you are someone who likes to test the vocabulary of a new knowledge domain (in this case, programming), here is an interactive page with the Think Python vocabulary on Memrise. - Goldwasser & Letscher, Sec. 3.1-3.2: Getting Started with Graphics
You should try to read these sections before your lab. It will make it easier for you to complete the lab tasks. This reading is also important for solving Task 3 on PS1.
Code
Click on this lecture_01.zip link to download the .zip
file to your computer. Unzip the downloaded lecture_01.zip file (by double-clicking on it) to reveal a folder with a few files we will use during lecture. Note that some computers may automatically unzip the file after you download it.
Here is a description of the content of the files in this folder:
-
lecture-01.ipynb
: The ending.ipynb
stands for interactive python notebook. This is a special file that you can open with Canopy, which we'll use often during lectures. You will not be creating such files yourselves. Every input cell is "run" independently of the others. However, order matters, especially when some variables are declared in previous cells. You can save all changes to this file (the outputs of the instructions), and "relive" the lecture at your pace. Alternatively, you can download the file again and test yourself in the short activities that these notebooks contain. -
lecture-01-graphics.ipynb
: A second (short) notebook to show how to build the Tinman graphic from the lecture slides. -
cs1graphics.py
: This is a Python module that needs to be present in order for us to create the Tinman graphics. You will not need to open or run the code of this file. We will only import its content in our program via a special Python instruction. -
nameage.py
: A simple Python script file. You'll open this in Canopy and execute its content with the Run button. This is the kind of file you'll be writing in labs and problem sets. -
tinman_with_grid.py
: The script version of the Tinman graphics, which adds two function calls to draw the reference points and a grid. cs1graphicsHelper.py
: The script that contains the functions used to draw reference points and the grid.