wk1.3
warm - up
- Create a dictionary called numbers with the keys 'one', 'two', 'three', and associated values 1, 2, 3 three different ways.
- Get the value from the dictionary for key 'one'.
- Update the value for key 'two' to 'dos'
- Add a new key value pair for 'four'/4
- delete the key value pair 'one'/1
- iterate over all the keys using a for loop
- iterate over all the values using a for loop
- iterate over all the key/value pairs (as a tuple) with a for loop (two different ways)
- Dictionary keys can be mutable (True/False?).
- Dictionary values can be mutable (True/False?).
- Dictionaries are an example of a homogeneous datatype (True/False?).
- Looking up a value in a list is generally faster than looking up a value in a dictionary (True/False?).
- Suppose I set dict2 = numbers. If I change dict2 will numbers stay the same? Why or why not?
Morning activity: pair code review
Pair up with another group and review each others code.
Grading
35 points possible
15: Program runs and consistently produces correct output for any scrambled word and any list of words.
5 point penalty for any of the following:
- Test cases running in addition to program functionality. (You need to 'comment out' any 'test' print statements for your final testing and turn-in.)
- Incorrect or missing counts of emails or dates.
- Other extra output, missing output, or output formatted differently than the examples above.
- 10: Follows PEP8 coding guidelines, including author identification and header.
- 10: Clarity. The program should not only be consistent with the requirements and approach described here, but it should be very easy to read the program and verify its consistency with the spec.