Я написал небольшое приложение с флажками, поэтому, когда я отмечаю один или оба из них, он должен напечатать определенную переменную, однако, проблема заключается здесь, когда я отмечаю оба флажка, я не получаю выводя хочу.Спасибо
from tkinter import *
class STproject():
def __init__(self,app):
self.CheckVar1 =IntVar()
self.CheckVar2 =IntVar()
self.button=Button(app,text='PRINT',command=lambda:self.functionality())
self.button.grid(row=0,column=0)
self.Lidbox=Checkbutton(app,variable=self.CheckVar1,onvalue=1,
offvalue=0)
self.Lidbox.grid(row=1,column=0)
self.Seperatorbox=Checkbutton(app,variable=self.CheckVar2,onvalue=1,
offvalue=0)
self.Seperatorbox.grid(row=1,column=1)
def functionality(self):
if self.CheckVar1.get():
print('first')
elif self.CheckVar2.get():
print('2nd part')
elif self.CheckVar1.get() and self.CheckVar2.get():
print('3rd part')
else:
print('4th part')
root=Tk()
root.title('SteelBox Inc. Calculator')
application=STproject(root) #2
root.mainloop() #3