assignments
1. getting started
due Tue Sep 4
- Read chapter 1 in the text.
- Install python version 3 on your computer, from python.org (If you don't have one, talk to the folks in the computer lab and/or Jim and we'll see what we can work out.)
- Run the "chaos" python program from the first chapter. (We'll discuss the nuts and bolts of how to do this in class.)
- Try some of the exercises at the end of chapter 1.
- Tell me about your tech and computer background - including what kind of computer you're used to using, what you'd like to get out of this class, and how well first assignment went for you.
2. functions, input, print, loops
due Tue Sep 11
- Read chapters 2 & 3.
- Look up the definition of the built-in range() function in the python docs (see the resources page or google it). Try it at the python prompt and explain what it does.
- Do chapter 2 exercises 1, 7, 10 (page 54 & 55).
- Do chapter 3 exercises 12, 14, 16.
- Let me know how all this is going.
3. graphics & objects
due Tue Sep 18
- Read chapter 4
- Do chap 4 exercise 3 (draw a face).
- Do chap 4 exercise 9 (rectangle information).
- Describe briefly in your own words and give a code example of the following concepts:
- class
- instance
- method
- argument
- Write a graphics program of your choice - make a random artwork, animate something, use mouse clicks to draw - whatever. (This doesn't need to be too fancy - we will have more coding tools like "if" statements later to do more.)
4. strings, lists, files
due Tue Sep 25
- Read chapter 5 in the text.
- Do these programming exercises from this chapter :
- 4 (acronyms) or 5 (name sum)
- 7 and/or 8 (on the Caesar cipher),
- 12 (formatted numbers), and
- 14 (read and summarize a file)
- 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.
- If you get stuck, please do find or email me or Merlin and/or talk to other folks in the class. Often times a small hint can get you over a hump.
5. functions
due Thu Oct 4
- Read chapter 6.
- Describe briefly the following notions, and give a code example.
- return value
- local variable
- global variable
- argument
- Do programming exercise 2 (the ants).
- Do programming exercises 11 through 14 (ending with the sum of squares of numbers from a file).
- Re-write any program a from previous assignment using functions for some parts of the code. For a really good time, put in docstrings and doctest tests too. :)
6. decisions
due Thu Oct 11
- Read chapter 7.
- Do programming exercise 6 (speeding ticket).
- Do programming exercise 12 (date validation).
- Do programming exercise 18 (exceptions).
- Propose a midterm coding project idea so that I can give you some feedback. (That assignment is listed below, though it isn't due for several weeks.)
7. booleans
due Tue Oct 23
- Read chapter 8.
- Do at least one of the following two programming exercises. Both will need loops or loops-within-loops, if statements, and (probably) helper functions.
- Write a python program to verify that either De Morgan's laws (i.e. the algebraic identities for "not (a and b)" and "not (a or b)" are correct by using a brute force search over all assignments of True and False to a and b. I showed some code in class that does most of this ... add some "if" statements and remove the printing so that it just confirms that the laws are correct.
8. midterm project
due Tue Oct 30
- Write 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.
9. defining classes
due Tue Nov 6
- 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 exercise 11 in chapter 10, implementing a playing card object.
- Modify any program you've written previously this semester to include a class definition.
10. data collections
due Tue Nov 13
- Read chapter 11.
- Look at programming exercise 15 in chapter 11: blackjack. Write code along those lines that has classes for a Card, a Deck, and a BlackJackHand, which lets you at least deal a hand and have a method that gives its blackjack value. The specific methods and connections between these classes are up to you. Optionally, use these classes (and possibly others such as Player or Game) to simulate a blackjack game.
- Propose a final project - same scale and concept as the midterm, but also demonstrating the new material we've seen in the second half of the term.
11. algorithms
due Tue Nov 20
- Work on your projects - post whatever you have so far, along with your thoughts.
- Read chapter 12, object oriented design.
- Start looking at chapter 13, algorithms and recursion.
- No written problems this week, other than the project.
12. final project submission
due Fri Dec 7
- Submit your final project writeup.
- Rules are the same as the midterm - submit your code, a description of what you did, a bibliography, and a show what it does when you run it.
- Your goal is to convince me that you understand the material we've been doing.
13. term grade
due Wed Dec 12