Question
Consider the following tkinter reference: and the following GUI that displays 3 lucky numbers each time the button is clicked. Choose the best option below
Consider the following tkinter reference:
and the following GUI that displays 3 lucky numbers each time the button is clicked.
Choose the best option below for filling in the blank in the code below to define the button:
import tkinter as tk import random def pickListener(): p1 = str(random.randint(1,10)) p2 = str(random.randint(1,10)) p3 = str(random.randint(1,10)) pickLabel.config(text = "Your lucky numbers: " + p1 + "-" + p2 + "-" + p3 ) gui = tk.Tk() gui.title("Midterm GUI") pick3 = _______________________________________________
pick3.grid(row=0, column=0, padx=25, pady=25) pickLabel = tk.Label(gui, text="") pickLabel.grid(row=0, column=1, padx=25, pady=25) gui.mainloop()
Group of answer choices
A. tk.Button(gui, text="Pick 3", command=pickListener)
B. tk.Button(gui, text= Pick 3, command="pickListener")
C. tk.RadioButton(gui, text="Pick 3", command=buttonListener)
D. Button(gui, text="Pick 3", command=myListener)
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started