assignments
due Tue Sep 10
Preliminaries
- Read chapter 1 in the text.
- Start getting your software tools in order :
- Install python on your computer, if it doesn't already have it, and if that's where you'll be doing your work. See python.org's download page for versions that match various operating systems. On a Mac, you can probably just open the terminal and type 'python'. For Microsoft Windows, see these options. If you have trouble, ask someone who has done this before for help.
- Install (if need be) a text editor (not a word processor - see my tools page).
- If you understand from the reading how to run a python program, do a few of the exercises at the end of chapter 1. (If not, ask Cory at a help session, or in class and we'll help you get going.)
- On the course page where you submit this week's work, tell me
- what your computer background is,
- what kind of computer you have access to and some familiarity with (i.e. mac laptop, windows desktop, linux tablet, lab computer only, ...). I'd be interested in the specifics of your setup if you know them.
- how all the work described above is going.
due Tue Sep 17
input, output, numbers, loops
- Read chapters 2 and 3 in the text.
- Do and submit exercises 1, 7, 10 on page 49 & 50, from the end of chapter 2.
- Do and submit exercises 12, 14, and 16 on page 74, from the end of chapter 3.
- Please do leave me a note with your homework if you have any questions or comments.
due Tue Sep 24
strings
- Read chapter 4 in the text.
- In chapter 4, do these programming exercises on pages 119 to 121:
- 5 (acronyms) or 6 (name sum)
- 8 and/or 9 (on the Caesar cipher),
- 13 (formatted numbers), and
- 15 (read and summarize a file) on pages 120 and 121.
- As always, be smart about the time and effort spent on this stuff. If it's too much, focus your attention on a few. If it's fast, turn up the juice on some aspect that seems interesting.
- And if you get stuck, please do find or email me or Cory, and/or talk to other folks in the class. Often times a small hint can get you over a hump.
due Tue Oct 1
graphics and objects
- Read chapter 5
- Do exercise 3 (draw a face) on page 160.
- Do exercise 12 (bar chart from file data) on page 162.
- Describe briefly the following terms with examples from your code:
- class
- instance
- method
- argument
- Write either a program that does some sort of graphics animation (e.g. makes something change over time as I did with "from time import sleep" and "import random") or that responds to mouse clicks, or both (the latest graphics.py has a win.checkMouse() that gives the last click, without waiting). All the details are left up to you : choose something that suits your background and skills.
- Are we having fun yet?
due Tue Oct 8
functions
- Read chapter 6
- Describe briefly the following notions, and give a code example.
- return value
- local variable
- global variable
- argument
- Do exercise 2 (the ants) on page 194.
- Do exercises 11 through 14 (sum of squares of numbers from a file) on page 196.
- Re-write any one program a from previous assignment, using functions for some parts of the code. For all the brownie points, put in doctests too.
due Tue Oct 15
conditionals
- Read chapters 7 and 8. (This is a lot - feel free to skim bits of it and come back to those parts later.)
- Do exercise 7 from chapter 7 on page 229.
- Do exercises 11 and 12 from chapter 8 on page 263.
- Optional but recommended : page 250 in the text describes "De Morgan's Laws". Write a python program that loops over all possible True/False values for A and B and shows explicitly that those "laws" are correct.
- Optional and loads of fun : Problem 9 from http://projecteuler.net: Find a,b,c such that a**2+b**2==c**2 and a+b+c=1000.
- A graded mini-project is due on Oct 29. (Next Tues Oct 22 is Hendrick's vacation; no homework due.) I'd like you to propose something that uses the what we've done so far : loops, conditionals, file i/o, ... It could do some sort of analysis or transformation of a file, or play a simple text oriented game, or use the graphics library. All I'm asking now is that you choose something so I can give you feedback as to how feasable that sounds.
due Tue Oct 22
catchup
- Hendrick's Days -- no work due today.
- Finish reading chapter 9
- Continue work on your midterm project. (An optional progress report here would be great.)
- Or catchup with any missed work.
due Tue Oct 29
mid-term projects
- Create a midterm web project of your choice, using what we've done so far and demonstrating your mastery of it.
- Your submission should include
- the source code itself, including appropriate docs and comments.
- a brief writeup explaining what you did, what it's supposed to do, what was easy and what wasn't, and discussing the technologies involved.
- include a bibliography of any resources (websites, books, ...) you used
- Your grade will be based on the following evaluation categories :
- concept : the technical merit of the idea itself, including its difficulty and planning
- mastery : how well the project shows your understanding of the course material
- style : the clarity of your code and other materials, and whether it follows accepted conventions
- completeness : does it feel finished, and what bugs are there
- support : appropriate docs, tests, sample output, screenshots, etc
- Questions? Ask.
due Tue Nov 5
defining classess
- Read chapter 10
- Write a short python program that
- defines a class of your own invention, representing a "thing" of your choice
- inclues an __init__ and __str__ method
- includes at least three other methods, some of which take arguments, some of which return things, which modify the object's values and/or print things out
- has a main() function that creates several instances of these classes and calls some of their methods to do whatever it is that your "thing" does.
- Do the "playing card" exercise, chapter 10 exercise 11 on page 333-334.
- Modify any program you've written previously this semester to include a class definition.
due Tue Nov 12
more classes and data collections
- Read chapter 11, on lists and using them with classes.
- Do exercises 14 and 15 from chapter 11.
- For your first version, do a limited version version of Poker, only looking at pairs, three of a kind, and four of a kind. (If you can get that working and have time and the inclination, feel free to implement the other types of poker hands too.)
- The overall task is to create the objects (classes) for Card, Hand, PokerHand, and Deck, and uses these classes to create two poker hands and say which one wins. Your main() program should be the only part that has any "print" statements, and should be short.
due Tue Nov 19
final project proposal
- Propose and start working on a final project. As described in class this should be:
- Similar in effort to the midterm project, but with a more "oomph" now that your skills are growing.
- Possible project ideas include
- a game (word game like boggle, board game like tic-tac-toe or battleship, or other like Nim (look up on wikipedia)
- a graphics animation (something using Zelle's graphics with something moving and some mouse click interactions)
- generating an interesting graphics figure, such as a fractal or random landscape or maze
- a simulation of a something (like the examples and exercises from chapter 12)
- a numerical problem (or problems, depending on the difficulty) from ProjectEuler.net
- Your work should blearly documented, tested or demonstrated. docstrings are recommended. doctests for functions are great but not required.
- Demonstrate your understanding of the recent material, particularly objects and dictionaries.
- As always, be clear on what is your own new work, and what is work you or others have done previously.
- A first draft is due the Tuesday after Thanksgiving ... which isn't that far away.
- Read chapter 12
- Do chap 12 exercise 4 , the ATM machine simulation (text input output, not a graphics GUI)
due Tue Nov 26
recursion
- Read chapter 13 in the text
- Do at least one problem from from numbers 3, 4, 5, 6, or 8 on pages 463 and following
- Work on your final project, and give me a status report.
due Tue Dec 3
rough draft of final project
- Please turn in a rough draft of your final project ... and get feedback.
due Tue Dec 10
class presentations
- Come to class ready to do a show'n'tell with your final project.
due Fri Dec 13
final project deadline
- Submit your final project, displaying all your cumulative skills.
- The format and rubric is the same as the midterm, namely
- Your submission should include
- the source code itself, including appropriate docs and comments.
- a brief writeup explaining what you did, what it's supposed to do, what was easy and what wasn't, and discussing the technologies involved.
- include a bibliography of any resources (websites, books, ...) you used
- Your grade will be based on the following evaluation categories :
- concept : the technical merit of the idea itself, including its difficulty and planning
- mastery : how well the project shows your understanding of the course material
- style : the clarity of your code and other materials, and whether it follows accepted conventions
- completeness : does it feel finished, and what bugs are there
- support : appropriate docs, tests, sample output, screenshots, etc
course grade
- a place for Jim to give overall feedback