I have a list of variables “m”. I need to put a variable “m[i]” in a function.
I know 2 options to do so: first option is to transform m[i] into local variable and a second option is to use “global”.
As far as I’m aware both are not working
One of the attempts:
m = list()
def count():
global m;i # "i" isn't defined
m[i].set(m[i].get()+1)
for i in range(a)
m.append(IntVar())
count()
New contributor
Aika is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.