I am sort of new to Python so I was reading through Pro Python and it had this section about passing variable keyword arguments to function. After reading that section I wrote the following code which doesn't seem to work.
def fun(**a):
return a['height'] if a is not {} else 0
I got a key error when I called fun with no arguments. How should I change the code so that it returns a['height'] if a is not a null dictionary and returns 0 if it is a null dictionary?