有如下Python代码,如图状态下,点击提交按钮,文本框内显示的内容为?( )

import tkinter as tk
def show_selected_option():
selection = variable.get()
p={1:"篮球",2:"排球", 3:"足球"}
label.config(text=f"最喜欢的运动是 {p[selection]}")
root = tk.Tk()
options = [("篮球", 1), ("排球", 2), ("足球", 3)]
variable = tk.IntVar()
for text, value in options:
tk.Radiobutton(root, text=text, variable=variable, value=value).pack()
button = tk.Button(root, text="提 交", command=show_selected_option)
label = tk.Label(root, text="最喜欢的运动是什么?")
button.pack()
label.pack()
root.mainloop()
正在加载题目数据…
子题
该题型需在试卷/作业中作答,单题练习暂不支持
答案解析