有如下程序:下列说法不正确的是?( )
import tkinter as tk
window = tk.Tk()
window.geometry('300x150')
window.title('my first window')
var = tk.StringVar()
label = tk.Label(window, textvariable=var)
label.pack()
on_hit = False
def hit_me():
global on_hit
if on_hit == False:
var.set('You hit me')
on_hit = True
else:
var.set('')
on_hit = False
button = tk.Button(window, text='hit me', width=15, height=1, command=hit_me)
button.pack()
window.mainloop()
正在加载题目数据…
子题
该题型需在试卷/作业中作答,单题练习暂不支持
答案解析