Announcements
- Lab 11 should be done before the final exam
- Our final exam is Friday, Dec 15, 7-10pm, in Sci Cen 101
Course Information
Section 2: MWF 11:30–12:20, Sci Cntr 256
Professor: Jeff Knerr
Office: Sci Cntr 238A (at back of 240 and 238)
Office hours: I will definitely try to be around on
Mondays from 2-4pm. You can also stop by whenever my door is open. I usually work from home on Thursdays.
Piazza: CS21 Q&A forum
Links to all sections:
Welcome to CS21. This course will introduce fundamental ideas in computer
science while also teaching you how to write computer programs. We will
study algorithms for solving problems and implement solutions in the
Python programming language. Python is an
interpreted language that is known for its ease of use. We also introduce
object-oriented programming and data structures. A deeper coverage of these
topics will be presented in CS 35.
This course is appropriate for all students who want to learn how to write
computer programs and think like computer scientists. It is the usual first
course for computer science majors and minors. Students with advanced placement
credit or extensive programming experience should place out of this course and
instead begin with CS31 or CS35.
Textbook:

We will primarily be using the online book
How to think like a computer scientist: Learning with Python by Elkner, Downey and Meyers.
See the
Schedule for each week's reading assignment.
Here are a few other useful online resources:
Goals for the course:
By the end of the course, we hope that you will have developed the
following skills:
- Given a program, be able to simulate on paper how a computer would
execute the program, and show the results that would be produced.
- Given a problem, be able to design a clear, concise, and
correct pseudocode algorithm to solve it.
- Given a pseudocode algorithm,
be able to successfully implement it in Python.
- Be able to use top-down design to sub-divide a large problem into
reasonably-sized modular sub-problems.
- Given several algorithms for solving the same problem, be able
to analyze which algorithm would be more efficient in terms of running
time.
- Develop debugging and unit testing skills. Consistently use
these skills while implementing programs.
Schedule
Here is the tentative schedule; it may change as we go...
WEEK |
DAY |
ANNOUNCEMENTS |
TOPIC & READING |
LABS |
1 | Sep 04 | | Introduction to Python and Unix
- python, unix, atom editor
- data types
- variables, assignment
- calling built-in functions
print() , type() , int() , float() , str()
- user input:
input()
def main()
- writing and running a program
- Ch 1: The way of the program
- Ch 2: Variables, expressions and statements
- Ch 4, Sec 9: keyboard input
- Ch 4, Sec 10: type conversion
| In class topics:
variables
variables (notebook)
Lab 0: unix, editing |
Sep 06 | |
Sep 08 | |
2 | Sep 11 | | Writing simple programs
for loops, sequences, range()
- accumulator pattern
- indexing,
len()
print()
from math import *
- Ch 2: Variables, expressions and statements
- Ch 2: lists, looping,
range()
- Ch 7: Strings (sections 1-4, 6, 13 only)
- Ch 9: Lists (sections 1-3, 5, 6, 8)
| In class topics:
for loops
accumulator
Lab 1: first programs
remote edit with atom |
Sep 13 | |
Sep 15 | Drop/add ends |
3 | Sep 18 | | Conditionals
| In class topics:
branching
and or not
str formatting
Lab 2: numbers and strings |
Sep 20 | Q1 study guide |
Sep 22 | Quiz 1 |
4 | Sep 25 | | First functions, while loops
| In class topics:
functions
random
while loops
Lab 3: if/else |
Sep 27 | |
Sep 29 | |
5 | Oct 02 | | Graphics, Using Objects
| In class topics:
graphics
Lab 4: while loops/functions |
Oct 04 | Q2 study guide |
Oct 06 | Quiz 2 |
6 | Oct 09 | | Fruitful Functions
| In class:
functions2
exceptions
Lab 5: graphics |
Oct 11 | |
Oct 13 | |
| Oct 16 | Fall Break |
Oct 18 |
Oct 20 |
7 | Oct 23 | | File IO, Top-Down Design
| In class:
file IO
top-down design
str and list methods
Lab 6: more functions |
Oct 25 | |
Oct 27 | |
8 | Oct 30 | | More TDD
| In class:
top-down design
str and list methods
Lab 7: 3square |
Nov 01 | Q3 study guide |
Nov 03 | Quiz 3 |
9 | Nov 06 | | Searching
| In class:
searching
Lab 7: 3square |
Nov 08 | |
Nov 10 | CR/NC/W Deadline |
10 | Nov 13 | | Sorting
| In class:
sorting
Lab 8: DH/searching |
Nov 15 | Q4 study guide |
Nov 17 | Quiz 4 |
11 | Nov 20 | | Classes and Objects
| In class:
classes
Lab 9: DH/sorting |
Nov 22 | |
Nov 24 | Thanksgiving |
12 | Nov 27 | | Classes and Objects
| In class:
classes
Lab 10: classes |
Nov 29 | Q5 study guide |
Dec 01 | Quiz 5 |
13 | Dec 04 | | Recursion
| In class:
recursion
Lab 11: recursion practice |
Dec 06 | |
Dec 08 | |
14 | Dec 11 | final exam study guide | Wrap up | In class: wrap up |
Dec 15 | Final Exam: Fri, Dec 15, 7-10pm, Sci Cen 101 |