有如下Python代码,执行该代码,说法不正确的是?( )
import tkinter as tk
window = tk.Tk()
window.title('ListBox')
window.geometry('300x350')
var1 = tk.StringVar()
label = tk.Label(window, bg='yellow', width=4, height=2, textvariable=var1)
label.pack()
def print_selection():
value = listbox.get(listbox.curselection())
var1.set(value)
button = tk.Button(window, text='print selection', command=print_selection)
button.pack()
var2 = tk.StringVar()
var2.set((11, 22, 33, 44))
listbox = tk.Listbox(window, listvariable=var2)
listbox.pack()
listitems = [1, 2, 3, 4]
for item in listitems:
listbox.insert('end', item)
listbox.insert(1, 'first')
listbox.insert(1, 'second')
listbox.delete(1)
window.mainloop()
正在加载题目数据…
子题
该题型需在试卷/作业中作答,单题练习暂不支持
答案解析