i got a problem to run the python, for example code in below, because the code not sure to see because i am beginner for this,and its too long too, i give the same problem on my code
from tkinter import *
from tkinter import ttk
root = Tk()
root.title('app')
class calculate:
def thefirst(self):
y1 = 1
def second(self):
v1 = 5 - y1
print(v1)
Button(root, text="GENERATE", command=second)
the problem is if i press the button for y1 not define
so i writte the code
from tkinter import *
from tkinter import ttk
root = Tk()
root.title('app')
class calculate:
def thefirst(self):
y1 = 1
def second(self):
for y1 from the first()
v1 = 5 - y1
print(v1)
Button(root, text="GENERATE", command=second)
but in my visual studio code got a red color problem, but the code is still not working to generate data, is my code wrong?
thank you