21. What is the purpose of the PanedWindow widget in Tkinter? A. Displaying images B. Arranging widgets horizontally C. Arranging widgets in a grid D. Creating dialogs Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option B Solution: The PanedWindow widget is used to arrange widgets horizontally with resizable panes.
22. How do you add an image to a Tkinter application? A. add_image() B. image.insert() C. Label(image=...) D. ImageWidget(image=...) Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option C Solution: The Label(image=...) syntax is used to add an image to a Tkinter application.
23. What is the purpose of the Text widget in Tkinter? A. Handling user input B. Displaying text C. Drawing graphics D. Creating message boxes Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option B Solution: The Text widget is used for displaying and editing multiline text in Tkinter.
24. How do you create a scrollbar for a widget with scrolling content? A. CreateScrollbar() B. Scrollbar() C. scrollbar.create() D. widget.add_scrollbar() Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option B Solution: The Scrollbar() function is used to create a scrollbar for widgets with scrolling content.
25. What is the purpose of the place() method in Tkinter? A. To set the position of a widget using absolute coordinates B. To arrange widgets horizontally C. To handle user input D. To create message boxes Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option A Solution: The place() method is used to set the position of a widget using absolute coordinates in Tkinter.
26. What is the role of the Spinbox widget in Tkinter? A. Displaying images B. Displaying a list of options C. Selecting a value from a range D. Drawing graphics Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option C Solution: The Spinbox widget is used for selecting a value from a range in Tkinter.
27. How do you create a message box for displaying alerts in Tkinter? A. dialog_box.show_alert() B. messagebox.alert() C. message_box.show() D. tkMessageBox.showinfo() Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option D Solution: The tkMessageBox.showinfo() function is used to create a message box for displaying alerts in Tkinter.
28. What is the purpose of the Scale widget in Tkinter? A. Displaying images B. Creating message boxes C. Handling user input D. Selecting values from a range Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option D Solution: The Scale widget is used for selecting values from a range in Tkinter.
29. How do you change the font of a widget's text in Tkinter? A. font.set("NewFont") B. widget.font("NewFont") C. widget.configure(font="NewFont") D. widget.set_font("NewFont") Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option C Solution: The widget.configure(font="NewFont") method is used to change the font of a widget's text in Tkinter.
30. What is the purpose of the Toplevel widget in Tkinter? A. Handling user input B. Displaying images C. Creating dialogs or new windows D. Drawing graphics Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option C Solution: The Toplevel widget is used to create additional dialogs or new windows in Tkinter.