CS 111: Introduction to Computer Science
Some Python basics
The lab exercises
During this lab, you will work with the following programs.
There are lots of ways to explore sample programs like these, but here's
a recommended procedure. For each sample program:
- Download the program to your working directory by right-clicking
on the link and choosing "Save Link As" or whatever similar option your
browser gives you.
- Open the sample program in a text editor (TextWrangler is a particularly good choice).
- Read the program with your partner. Discuss what you think the
program will do.
- Run the program (by typing, for example, "python strings0.py" in the
Terminal window). See if your predictions about the program were true.
If not, try to figure out why not.
- Try to answer the questions in the program's comments. You may want
to test your answers by making changes to the program in your text
editor, saving the changes, and running the program again. Play around
with the program until you feel comfortable with all its operations.
Ask questions.
- Move on to the next program.
Your assignment, due 11:59PM Monday, January 11
Here is the assignment description.