assignments
due Tue Sep 6
Getting Started
- Read chapter 1 in the text.
- Work on getting your software tools in order and starting to see how to use them :
- Install python on your computer, if it doesn't already have it, and if that's where you'll be doing your work. We'll discuss specifics in class. See the resources pages for links. (
- Install a text editor, if you don't already have one. (Not a word processor - see my tools page.)
- (Optional but recommended) If you're on Windows, install GitBash - a unixlike command shell. (If you're on a Mac or Linux machine, you already have this shell available through the Terminal or similar application.)
- With these tools you can create/edit a program, e.g. myprogram.py, and then from the command shell run python on it, e.g. "python myprogram.py". So if you understand from the reading and class discussion how to get this stuff working and run a python program, do a few of the exercises at the end of chapter 1. If not, then get help, either from me in my office sometime (schedule a time), or from the computer tutor.
- 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 13
input, output, numbers, loops
- Read at least up through chapters 2 and 3 in the text.
- Do and submit exercises 1 (convert with intro print), 7 (interest futvl.py modification, 10 (unit conversion) on page 49 & 50, from the end of chapter 2.
- Find and read the documentation for the built-in range() function. Explore (at the interactive python prompt) what it produces when invoked with various arguments.
- Do and submit exercises 12 (sum of cubes up to n), 14 (average of user entered numbers), and 16 (nth Fibonnaci number) on page 74, from the end of chapter 3.
- Let me know how all this is going for you.
due Tue Sep 20
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 Dylan and/or talk to other folks in the class. Often times a small hint can get you over a hump.
due Tue Sep 27
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.
due Tue Oct 4
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 11
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 25. (Tues Oct 18 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 feasible that sounds.
due Tue Oct 18
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 25
mid-term projects
- Create a midterm coding 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.
- output : what it looks like when it runs
- a brief write-up 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 1
defining classes
- Read chapter 10
- Write a short python program that
- defines a class of your own invention, representing a "thing" of your choice
- includes 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 8
more classes and data collections
- Read chapter 11, on lists and using them with classes.
- Do exercises 14 and 15 from chapter 11.
- Write a limited version version of Poker, looking at most 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. You can use my examples from the class notes as a starting point; if so, quote your source and make what is your work clear.
- Start thinking about a possible final project - next assignment will ask you for a proposal.
due Tue Nov 15
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 22
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 Nov 29
rough draft of final project
- Please turn in a rough draft of your final project ... and get feedback.
due Tue Dec 6
class presentations
- Come to class ready to do a show'n'tell with your final project.
due Fri Dec 9
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's end of the semester feedback