e=Entry(root)
e.pack()
l=Label(root,text="")
l.pack()
def pd():
a=int(e.get())
if a>0:
if a%2==0:
l.config(text="是偶数",fg="black")
else:
l.config(text="是奇数",fg="black")
else:
l.config(text="非奇非偶",fg="red")
e=Entry(root)
e.pack()
l=Label(root,text="")
l.pack()
def pd():
a=int(e.get())
if a>0:
if a%2==0:
l.config(text="是偶数",fg="black")
else:
l.config(text="是奇数",fg="black")
else:
l.config(text="非奇非偶",fg="red")