x = 0 def add(): global x x += 1 label1.config(text = x)
I don’t like how I initialize a variable outside a function. It feels messy and harder to read. Is there any way that’s a bit clearer? Some way to perhaps initialize the variable in the function.
submitted by /u/AWS_0
[link] [comments]
r/learnpython x = 0 def add(): global x x += 1 label1.config(text = x) I don’t like how I initialize a variable outside a function. It feels messy and harder to read. Is there any way that’s a bit clearer? Some way to perhaps initialize the variable in the function. submitted by /u/AWS_0 [link] [comments]
x = 0 def add(): global x x += 1 label1.config(text = x)
I don’t like how I initialize a variable outside a function. It feels messy and harder to read. Is there any way that’s a bit clearer? Some way to perhaps initialize the variable in the function.
submitted by /u/AWS_0
[link] [comments]