Python UnboundLocalError Solution | Fix

preview_player
Показать описание
Python UnboundLocalError Solution
Explanation:
Python doesn't have variable declarations, so it has to figure out the scope of variables itself. It does so by a simple rule: If there is an assignment to a variable inside a function, that variable is considered local.

UnboundLocalError: local variable 'var' referenced before assignment

#python #programming #coding
Рекомендации по теме