from tkinter import *
def a():
b = d.get()
if b == 3:
label1.config(text="回答正确")
else:
label1.config(text="回答错误")
c=Tk()
c.geometry("400x400")
c.title("单选题")
label1 = Label(c,text="问琵琶行中“嘈嘈切切错杂弹“的上一句为何?",bg="green",font=("华文仿宋,300"))
label1.pack()
d = IntVar()
radiobutton1 = Radiobutton(c,text="大弦嘈嘈如急雨",font=("华文仿宋,200"),variable=d,value=1,command=a)
radiobutton1.pack()
radiobutton2 = Radiobutton(c,text="大珠小珠落玉盘",font=("华文仿宋,200"),variable=d,value=2,command=a)
radiobutton2.pack()
radiobutton3 = Radiobutton(c,text="小弦切切如私语",font=("华文仿宋,200"),variable=d,value=3,command=a)
radiobutton3.pack()
radiobutton4 = Radiobutton(c,text="间关莺语花底滑",font=("华文仿宋,200"),variable=d,value=4,command=a)
radiobutton4.pack()
c.mainloop()