Why does Python complain about chrome
being referenced before assignment? It does not complain about the dictionary. This is with Python 2.5 if it makes a difference.
def f():
google['browser'] = 'chrome'
chrome += 1
google = dict()
chrome = 1
f()
I can make it work with global chrome
of course, but I'd like to know why Python does't consider the variable to be assigned. Thanks.