# UnboundLocalError: local variable 'D' referenced before assignment
# Python Introductory Course 8.-10. April 2019
# Python 3.7

D = {}

def foo():
    if False:
        D = {}
    D["blue"] = "blau"
    print("D local:", D)   
    return D
 

D = foo()
print(D)

PyDLR (zuletzt geƤndert am 2019-04-10 20:05:50 durch HubertHoegl)