Unused Variable But The Variable Exists

Hi, I’m getting this weird error that a variable i’m using is “unused” when it’s clearly been declared in the function.
I have a screenshot here.

It doesn’t say the variable is unused, it’s complaining that the variable is declared as global (since there’s no local keyword) but it’s not uppercase, as globals usually are. Either make the variable local or put it in self if you want to keep the value between function calls.

2 Likes

Ah I see. I just changed it per your advice and that fixed it.
Much thanks!