UnboundLocalError: cannot access local variable where it is not associated with a value in Python: 10 Causes and Fixes (Tested Examples)
Python raises UnboundLocalError: cannot access local variable 'x' where it is not associated with a value when a function reads a name that Python has decided i…

