Tentative Schedule

back to Class website

 
Week Tues Date Schedule Assignments
1 Aug. 23 Course Intro, Preliminaries,chapter 1week 1 lab due Tues of week 2
2 Aug. 30 Chapters 2, 3week 2 lab
3 Sept. 6 Chapter 4, chapter 4 prev version (graphics) week 3 lab
4 Sept. 13 Chapter 5, basic html week 4 lab
5 Sept. 20 Chapter 6, python CGI week 5 lab,     Project 1 form
Project 1: printout due Tues, Oct 4, 10pm
6 Sept. 27 Quiz review, Chapter 7 week 6 lab due Tues Oct 18th
7 Oct. 4 Midterm review Tues, Midterm Thurs Project 1 printout due Tues 10pm
8 Oct. 11 Tues is Fall Break, class meets Thurs: string algorithms
9 Oct. 18 Chapter 9
code from lecture
ASCII chart and code
quiz6: Correct the 11 mult choice questions from the midterm:
for all you got wrong state why your answer is wrong and the correct answer is right.
Provide loop traces for loop questions that you got wrong.
week 9 lab;   Project 2: printout due Tues, Nov 3, 10pm
10 Oct. 25 finish Chapter 9,
Begin Chapter 10, file reading of a maze
week 10 lab due Nov 10th (updated),
do free response midterm corrections for Quiz 8 due Tues Nov8
11 Nov. 1 finish Chapter 10,
Begin Chapter 11: Recursion, Exceptions
Project 2 due Tues 10pm, week 11 lab due Nov 22nd
12 Nov. 8 finish Chapter 11  
13 Nov. 15 Binary Search, Midterm review Tues, midterm Thurs  
  Nov. 22 Classes, Objects and Inheritance draw class example
employ.py, empDB.py
Thurs is Thanksgiving break
Project 3 printout due Tues, Dec 6, 10 pm
Quiz10: correct midterm questions 1-7, due Thurs, Dec 1st
Quiz11: correct midterm questios 8-14, due Tues, Dec 6th
14 Nov 29 Classes and methods class for complex numbers
methods: __init__, __str__, and add
 
15 Dec 6 Tues is last class, final review
Notes from code camp1, Basic Algorithms
Ex of simple class
code camp 2 notes
code camp 3 notes
Project 3 due Tues
16 Dec 13 Final exam is Thurs, Dec 15th, 3 - 5 pm  

Some Linux commands:

Assignments and Projects

Week i Assignments are due before midnight on the Tues of week (i+1). Project deadlines are specified when assigned.
The text is the free online text: How to Think Like a Computer Scientist: Learning with Python
Part of your assignment for week 1 (below) is to create a website where you will turn in all of your assignments.
When uploading to your website, copy and paste 1) your answers to questions, 2) runs that demonstrate that your solution is correct, 3) any code you wrote to get your results.
Projects must be documented and tested.

Week 1

Week 2

Code to get input, convert inches to centimeters and output result:
inches = input("Enter the length in inches: ")
cent = 2.54* inches
print inches, " in equals ", cent, " cm"

Function to convert inches to centimeters:
# Returns the number of centimeters that is equal to the number of inches in inch
def inchesToCentimeters(inch):
    cm = 2.54* inch
    return cm

Main program that calls the function inchesToCentimeters:
inches = input("Enter the length in inches: ")
cent = inchesToCentimeters(inches)          # this is the function call: note that if the result is not assigned to a variable, it will be discarded
print inches, " in equals ", cent, " cm"

Week 3

If you want to install turtle graphics on your laptop, directions are here.
Make sure Tkinter is already installed. Type: import Tkinter. If you get an error, then you need to install Tkinter as well.
Download the swampy zipfile for the version for Python2.x
Unpack the zip file, then you must modify the search path:
The expected convention for locally installed packages is to put them in the .../site-packages/ directory. Then you add a file, named swampy-2.0.pth, to that same site-packages directory. swampy-2.0.pth should containing these two lines:
   # swampy-2.0 package configuration
   swampy-2.0
However, especially if you are a Mac user, you may want to install Python modules into some arbitrary directory. Here are additional instructions on how modify the search path after you do this. This brings you down the page to: Modifying Python's Search Path.

Week 4

Week 5

Week 6
Note that due date is out of the ordinary: due Tues Oct 18th.

For project 1 due Tues, Oct 4, 10pm:
First debug your 2 functions that do not involve the web form:
1. Debug your function that counts CAG repeats in the DNA
2. Debug your function that determines the output depending on the number of CAG repeats. The output includes both the classification and the disease status from the project specification. The easiest way for you to write this function is to return a "tuple" that contains both these values. For example, if there are 2 repeats, your function would execute the line:
return ('Normal', 'Unaffected')
Then catch these return values by assigning them to a tuple in main. Ex:
(classification, status) = < your function call >
Pass them to your string template that displays your disease prediction after your form:
resultString = "Number of repeats is: %s, Classification is: %s, Disease status is: %s"%(numCAGs, classification, status)
The "%s" are replaced by string variables that you pass to the string template. In this example, The first "%s" will be replaced by the contents of string variable "numCAGs", the second "%s" will be replaced by the contents of string variable "classification" and the third "%s" will be replaced by the contents of string variable "status".

It's difficult to debug CGI in a browser.
Instead, debug your CGI program on the command line: at the prompt when you would ordinarily type:
python hunt.py
you can instead type a query string as you would see it as part of the URL after you click submit. For example:
QUERY_STRING="first_name=Patricia&last_name=Francis-Lyon&dna=CAGC" python hunt.py
Python will consider these arguments as if they vame from the URL and the web server, and will render your web page to the terminal.
(Of course, you must use the name of your program in place of hunt.py and you must use your form variables (the name from the input tag) in place of first_name, last_name and dna).

Week 9

Week 10

Week 11

Final exam
Final exam is Thurs, Dec 15th, 3 - 5 pm
No phone, calculator or computer use
Can bring single sheet of notes, front and back
like midterms and quizzes except also know classes:
     to the extent of classes we discussed: Complex, Gravity, Point, Rectangle
assignments: especially chapters 6, 7, 9, 10, 11
midterm1 review sheet except no CGI
midterm2 review sheet
know 6 basic algorithms, be able to use them to solve problems (basicAlgs.py)
know both while loops and for loops
recursion, but no nested number list, level of difficulty like #13 on midterm2
exceptions: know the flow of code