Notes for Session 06¶
4/26/2018
A collection of notes to go over in class, to keep things organized.
Issues that came up during the week.¶
Getting an arbitrary key from a dict¶
See arbitrary_key.py
in examples/session05
dict as switch – how do you leave the loop?¶
Let’s look at a particularly nifty solution:
solutions/Lesson05/mailroom_dict_as_switch
globals??¶
a number of folks have been putting code in the global (module) namespace:
the_dict = {}
def fun():
...
the_dict = something()
What’s wrong with this?
Advanced Argument Passing¶
All this *arg
, **kwargs
stuff a bit confusing?
Let’s explore it a bit.
AND – we’ll use TDD to do it.
Exercise here:
https://uwpce-pythoncert.github.io/PythonCertDevel/exercises/args_kwargs_lab.html