from tkinter import *
def a():
b=yjb.get()
if b==3:
label1.config(text="回答正确")
else:
label1.config(text="回答错误")
top=Tk()
top.geometry("300x400")
top.title("单选题")
label1=Label(top,text="张平最喜欢干什么??",bg="pink")
label1.pack()
yjb=IntVar()
radiobutton1=Radiobutton(top,text="偷鸡腿给罗娟吃",variable=yjb,value=1,command=a)
radiobutton1.pack()
radiobutton2=Radiobutton(top,text="偷内衣给佳佳穿",variable=yjb,value=2,command=a)
radiobutton2.pack()
radiobutton3=Radiobutton(top,text="导管",variable=yjb,value=3,command=a)
radiobutton3.pack()
radiobutton4=Radiobutton(top,text="偷坤巴给佳佳嗦",variable=yjb,value=4,command=a)
radiobutton4.pack()
top.mainloop()