My query is on the below program with respect to symbols that are storing values and functions, when ran on http://pythontutor.com/.
Dictionaries on dictionaries. Dictionaries are the number 1 most important structure in Python.
It is the key of an entry in the current scope's dictionary. The value is the object 2.
It is not that functions are objects, but that some objects are functions. Or numbers. Or dictionaries.
It is the key of an entry in the current scope's dictionary. The value is sub.