from tkinter import *
def a():
b=gebo.get()
if b==1:
label1.config(text="回答正确")
else:
label1.config(text="回答错误")
top=Tk()
top.geometry("300x400")
top.title("单选题")
label1=Label(top,text="一个人有几个坤吧",bg="green")
label1.pack()
gebo=IntVar()
radiobutton1=Radiobutton(top,text="1",variable=gebo,value=1,command=a)
radiobutton1.pack()
radiobutton1=Radiobutton(top,text="2",variable=gebo,value=2,command=a)
radiobutton1.pack()
radiobutton1=Radiobutton(top,text="3",variable=gebo,value=3,command=a)
radiobutton1.pack()
radiobutton1=Radiobutton(top,text="4",variable=gebo,value=4,command=a)
radiobutton1.pack()
top.mainloop()