assignments
1. getting started
due Mon Jan 29
- 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.
2. input, output, numbers, loops
due Sun Feb 4
- 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.
3. strings
due Sun Feb 11
- 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.
4. graphics and objects
due Sun Feb 18
- 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.
5. functions
due Sun Feb 25
- 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.
6. conditionals
due Mon Mar 5
- 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 : 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 a2+b2==c**2 and a+b+c=1000.
- A graded mini-project is due by the end of the week after spring break. 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.
7. midterm project
due Sun Apr 1
- 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.
- If you're taking this for reduced credit ... don't do this. :)
8. defining classes
due Mon Apr 9
- Read chapter 10.
- Write a short python program that
- defines a class of your invention
- includes __init__ and __str__ methods
- 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.
- Modify any program you've written previously this semester to include a class definition.
9. final project proposal
due Mon Apr 16
- (No class today - Jim is out of town. You can if you wish hand this in Wed April 18.)
- Read chapters 11 & 12.
- Pick and do any two problems from those two chapters.
- 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. Your goal is to show your understanding of the topics covered this term.
- 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.
10. recursion
due Mon Apr 23
- Read chapter 13.
- Do at least one of the problems from that chapter.
- Work on your final project.
11. present final projects
due Wed May 2
- Come to class ready to show your final project.
12. final project submission
due Fri May 4
- 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
13. term grade
due Wed May 9
- a place for Jim's term feedback.