11. What is the purpose of the Canvas widget in Tkinter? A. Displaying images B. Drawing graphics and shapes C. Playing audio D. Handling user input Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option B Solution: The Canvas widget is used for drawing graphics, shapes, and images in Tkinter.
12. How do you create a dropdown menu in Tkinter? A. DropdownMenu() B. CreateMenu() C. OptionMenu() D. MenuDropdown() Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option C Solution: The OptionMenu() function is used to create a dropdown menu in Tkinter.
13. What is the role of the Checkbutton widget in Tkinter? A. Displaying images B. Handling mouse clicks C. Selecting multiple options D. Drawing shapes Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option C Solution: The Checkbutton widget allows the user to select multiple options from a list.
14. What is the purpose of the Radiobutton widget in Tkinter? A. Playing audio B. Drawing shapes C. Selecting a single option from a list D. Handling mouse clicks Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option C Solution: The Radiobutton widget allows the user to select a single option from a list.
15. How do you create a message box in Tkinter to display alerts or messages? A. messagebox.create() B. dialog_box.show() C. tkMessageBox.alert() D. messagebox.showinfo() Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option D Solution: The messagebox.showinfo() function is used to create a message box in Tkinter.
16. What is the purpose of the LabelFrame widget in Tkinter? A. Displaying images B. Grouping related widgets C. Handling user input D. Drawing graphics Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option B Solution: The LabelFrame widget is used to group related widgets together in Tkinter.
17. How do you set the title of a Tkinter window? A. title.set("New Title") B. window.title("New Title") C. window.set_title("New Title") D. set_window_title("New Title") Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option B Solution: The window.title("New Title") method is used to set the title of a Tkinter window.
18. What is the purpose of the Menu widget in Tkinter? A. Handling user input B. Drawing graphics C. Creating message boxes D. Creating dropdown menus Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option D Solution: The Menu widget is used to create dropdown menus and submenus in Tkinter.
19. How do you create a slider widget in Tkinter for selecting a value from a range? A. Scale() B. Slider() C. RangeSlider() D. ValueSlider() Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option A Solution: The Scale() function is used to create a slider widget in Tkinter.
20. Which method is used to set the size of a widget in Tkinter? A. set_size() B. resize() C. size() D. config() Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option D Solution: The config() method is used to configure the properties of a widget, including its size.