Home / Assignment 1.1

Assignment 1.1: Functions 2, and Dictionaries

You are not logged in.

If you are a current student, please Log In for full access to this page.

1) Readings

Please read this assignment's readings and work through the exercises contained therein.

2) Drills

Note: Effective Use of Drills

You should attempt these drills without running your code in Python, and only fall back to running your code if necessary. If you do have to fall back to using Python, it is crucial that you take the time to understand not only the result you got, but also why Python behaved the way it did.

Always, if you are having trouble with a question or can't figure out why Python is behaving the way it does, just ask!

  1. List Functions
  2. 2-dimensional Arrays
  3. Dictionary Transcript
  4. Functions Are First-Class
  5. Functions and Scope
  6. Composing Functions

3) Practice Exercises

Note: Effective Use of Practice Exercises

A good set of goals is:

  • work every problem as far as possible on your own (at least 10 minutes per problem).
  • do not run any Python code until you have simulated it on paper using environment diagrams and are confident that it will produce the right answer.
  • run and test your code on your own machine using Python before submitting (and, if it doesn't work, go back to the paper form to fix it before running it again).
  • try to use as few submissions as possible.
  • look at our solution once you have gotten the problem right, and compare it with your own.
  1. Run Length Encoding
  2. Dictionary Swap
  3. Dictionary Map
  4. Put It On My Tab
  5. Approximate Numeric Calculus
  6. Tree Max
  7. Hailstones