CS0008: Sp 2015

Schedule

This schedule will be filled out as the class progresses.

Day Date Topics, Slides, Code Readings Assignments, Labs, Exam info
1 1/06 Introduction

Slides
bio_calc.py.txt

2 1/08 Hardware and software, operators, types,
Operators; assignment.
Slides

Python Shell Lecture 2
Chapter 1; Appendix B (on IDLE).
L 1/12 Lab Handout Lab 1 (attendance needed for credit)
3 1/13 Input from the keyboard, formatted printing, Expressions versus statements. Perhaps start functions, scope.
input.py.txt
columns.py.txt
first_functions.py.txt
nestedFunctionCalls.py.txt

We ran the code in pythontutor.org;
try it out yourself!
Chapters 2-3
4 1/15 Functions, scope, problem solving.
scope.py.txt
variableArguments.py.txt
taxes.py.txt
Chapter 5.1-5.8
L 1/19 No classes
5 1/20 Problem solving; begin loops.
trace1.py.txt
song.py.txt
time_converter.py.txt
time_converterV2.py.txt
future_value.py.txt
6 1/22 More on functions and scope; if-then statements

globalVars.py.txt
noGlobalVars.py.txt
keywordArguments.py.txt
new_bio_calc.py.txt
stringComparisons.py.txt
ifThenElse.py.txt
loanQualifier.py.txt
loanQualifier2.py.txt

**Python Shell** from class today, showing the boolean expressions. .
Assignment 1 Due.
The assignment is available here.

If you need help getting started on Part 1, here is the frame of the program we covered in class 1/15.

Here are submission instructions!
L 1/26 Lab Handout
lab2_1.py.txt
lab2_2.py.txt
lab2_3.py.txt
Lab 2 (attendance needed for credit)
7 1/27 More on if-statements; conditions; logical operations; strings.
stringFuns.py.txt
Chapter 8 Prep exercises for Assignment 2
8 1/29 Loops
Python Shell.
askAndCountVowels.py.txt
infiniteLoop.py.txt
noValidateInput.py.txt
validateInput.py.txt
Chapter 4
L 2/02 Lab Handout Lab 3 (attendance needed for credit)
9 2/03 Go over what to expect for Exam 1 (see files below).

Go over Assignment 1 and an extension of Part 2 that tests for valid input.

Assignment 1, Part 1 solution covered in class (you can get it from Courseweb).

A solution to the Assignment 1 program.

An extended solution to the Assignment 1 program.
10 2/05 Exam 1
Information about Exam 1
Answers to sample questions.
Exercise, after you took the exam.
L 2/09 Lab Handout
puzzle.py.txt
Lab 4 (attendance needed for credit)
11 2/10 Nested Loops
printTimes.py.txt
rectangularPattern.py.txt
trianglePattern.py.txt
mystery.py.txt
Assignment 2 Due.
The assignment is available here.
Here are the prep exercises listed above
12 2/12 Standard Libraries and Modules; start Files and Exceptions
mathfuns.py.txt
circle.py.txt
rectangle.py.txt
geometry.py.txt
Chapter 5.9-5.10
L 2/16 Lab Handout Lab 5 (attendance needed for credit)
13 2/17 I was informed at 1:20pm that the building would be closed for at least an hour (our class will be over). So, class is cancelled today. See you on Thursday! Note: you did well on the first exam, but be aware that the material gets more complex. Stay with it! Chapter 6
14 2/19 Assignment 2 handed back today.

Grading for Part 1 was 98% Correctness. If you did not get Part 1 working, you are strongly encouraged to still do so. Be sure to do the Assignment 2 prep exercises -- they isolate key programming issues.

See also the exercise added above for Exam 1.

While your grade will not change, what really matters is your final grade (and how much you learn!) The class assumes from this point forward that you were able to correctly solve Assignemnt 2 by yourself. Feel free to see one of the three TAs or me if you have Python questions or need suggestions for how to proceed.

March 6 is the deadline to withdraw from the course.

Topics now covered today: Files and Exceptions

file_write.py.txt
file_read.py.txt
line_read.py.txt
strip_newline.py.txt
write_numbers.py.txt
write_numbers1.py.txt
sales.txt
read_sales.py.txt
read_sales2.py.txt
exception.py.txt
L 2/23 Lab Handout
lab6.dat.txt
Lab 6 (attendance needed for credit)
15 2/24 Below are topics and files originally planned for 2/19:

Exceptions; Problem solving.
verify.py.txt
verifyWithException.py.txt
verifyWithExceptions1.py.txt

Python Shell showing string.split(), list.append(), and indexing nested list elements.

Notes about writing verify.py
Chapters 7 and 8
16 2/26 Lists, Tuples, Strings. Problem Solving.
listExercises.py.txt
printUntil8.py.txt
Practice in the shell
Assignment 3 Due.
The assignment is available here.

The TA will run your programs on the input texts we gave you and will automatically compare the output with the output texts we gave you. Thus, for 100% correctness marks, your output must match the given output exactly. If you run into some difficulty, contact the TA at least 2 days before the assignment is due.
L 3/02 Lab Handout Lab 7 (attendance needed for credit)
17 3/03 Problem solving with lists, strings, tuples.

Notes during class
remove_i_broken.py.txt
remove_i_correct.py.txt
remove_0_from_list.py.txt
index_list.py.txt
18 3/05 Dictionaries

inverted_dict.py.txt
testScoresDict.py.txt
Chapter 9
3/09 No classes
3/10 No classes
3/12 No classes
L 3/16 Lab Handout
Code to read in "birds.txt"
birds.txt
Note: this lab is shorter than the others. Use the remaining time to ask questions of the TAs and review old Lab solutions with your partner. Lab 8 (attendance needed for credit)
19 3/17 Notes based on Labs, to review for Exam 2.
20 3/19 Exam 2
Information about Exam 2
L 3/23 Lab Handout

lab9start.py.txt

smallInput.txt

lab9output.txt - what your program should produce
Lab 9 (attendance needed for credit)
21 3/24 wannabe.py.txt
midsummernight.txt
fairytale.txt
alice.txt
prideandprejudice.txt
wannabe_starter.py.txt
wannabe_starter2.py.txt
simple.txt
simple_1.txt
simple_1_txt_and_dict.txt
simple_txt_and_dict.txt

Scientific Paper Generator
22 3/26 Processing different forms of input data.

hopedale.txt
singleLinesIncorrect.py.txt
singleLinesCorrect.py.txt
singleLinesCorrectMissingData.py.txt
hebron.txt
lynx.txt
multiLines.py.txt
multimol.pdb
multimol.py.txt
multimol_no_ends.pdb
lookahead.py.txt
L 3/30 Lab Attendance is optional. For this Lab, come and ask the TAs for help with any problems you are having with Assignment 4. There are only 2 of them, so they will give priority to people who have clearly been working on the assignment.
23 3/31 string_to_list.py.txt
http://www.madtakes.com/
madlib.py.txt
madlibBetter.py.txt
madlibBest.py.txt
madlibBest1.py.txt
Assignment 4 Due

(3/28 10am): for those using Windows rather than unix/linux/MAC, you should compare your "large" output with a different file. Please go to the TA's website to download the new file. Though the note below is still relevant; don't let the file processing stop you from completing the rest of the assignment.

FOR THOSE CONFUSED about calling python from the command line/terminal; or, for those who have run into problems using "fc" on windows: Go ahead and (1) work only with smallInput.txt and smallOutput.txt; (2) replace sys.argv[1] in your program directly with the filename, "smallInput.txt"; (3) use your own eyes, rather than "fc", to check if your output is correct. This way, you can get everything working, except for working with the files.
The writeup is available here.
24 4/02 Go over Exam 2; Finish Madlib. Chapter 10
L 4/06 Lab Handout Lab 10 (attendance needed for credit)
25 4/07 Classes; Pickling.
bankaccount2.py.txt
account_test2.py.txt
pickle_objects.py.txt
unpickle_objects.py.txt
Today, I will hand back feedback on Assignment 4, but without grades. There is no Assignment 5. Instead, you will modify your code to address the negative feedback, and submit a revision. Given that you have the chance to revise, the grading will be very strict.
26 4/09 Example using classes and pickling
contact.py.txt
contact_manager.py.txt

Example, Developing a Class
joesautomotiveshop.txt
servicequote.py.txt

Practice - important! to prepare you for the final exam. shellpracticeForFinal.py.txt
L 4/13 Lab Optional TAs will review and answer questions.
27 4/14 Database system implementations as dictionaries of dictionaries
dict_of_dicts.py.txt
db.py.txt
particles.py.txt
subatomi.py.txt
The material covered today will definitely be on the final
28 4/16 Note that CS401, the next programming class you would take, does not assume you already know Java. But, it would be a good idea to get somewhat familiar with it before you take the class.
For those interested, here is an eBook on Java for Python programmers.
Revision of Assignment 4 Due at 1pm (by class). No late revisions will be accepted.
4/25 Final: 12:00pm-1:50pm Finals Week