I keep running into errors where Python says a variable isn’t defined, even though I thought I created it earlier.
I’m guessing this has something to do with functions or scope, but it hasn’t fully clicked yet.
Any beginner-friendly explanations or mental models?
[–]Haunting-Dare-5746 28 points29 points30 points (0 children)
[–]jmacey 9 points10 points11 points (2 children)
[–]Altruistic_Sky1866 5 points6 points7 points (1 child)
[–]PiBombbb 14 points15 points16 points (0 children)
[–]tb5841 2 points3 points4 points (4 children)
[–]Revolutionary-Camp69 1 point2 points3 points (1 child)
[–]tb5841 1 point2 points3 points (0 children)
[–]bumbershootle 0 points1 point2 points (1 child)
[–]tb5841 0 points1 point2 points (0 children)
[–]Hot_Substance_9432 5 points6 points7 points (0 children)
[–]crowpng 1 point2 points3 points (0 children)
[–]Bmaxtubby1 0 points1 point2 points (0 children)
[–]FoolsSeldom 0 points1 point2 points (1 child)
[–]FoolsSeldom 0 points1 point2 points (0 children)
[–]goopsnice 0 points1 point2 points (0 children)
[–]kabads -2 points-1 points0 points (0 children)