1c. Dictionary Flashcards
1
Q
dictionary method (x3+2 default)
A
.keys .values .items => return tuples .get(key, default value) .setdefault(key, some value) => only assign if there is no key
2
Q
nice printing of dictionary
A
pair \n and in order
import pprint
pprint.pprint(mydict)