ThatQuiz Test Library Take this test now
OA reviewer PROG.
Contributed by: Mc G'nnagale
  • 1. 1.
    How do you access the active worksheet?
A) None of These
B) wb.current
C) wb.active <
D) wb.main
E) wb.sheet
  • 2. 2. What does the geometry("300x200") method do?
A) Sets the window size
B) Sets the widget size <
C) Sets the font size
D) Sets padding
E) None of These
  • 3. 3. Which function is often used to trigger saving Excel data in a Tkinter app?
A) None of These
B) Button command <
C) Label text()
D) Menu bind()
E) Entry get()
  • 4. 4. How do you create a new sheet?
A) wb.new_sheet("NewSheet")
B) wb.create_sheet("NewSheet") <
C) None of These
D) wb.insert("NewSheet")
E) wb.add("NewSheet")
  • 5. 5. Which widget is best to show Excel data in Tkinter?
A) None of These
B) Text()
C) Label()
D) Listbox()
E) Treeview() <
  • 6. 6. Which parameter controls text color?
A) front
B) color
C) text_color
D) fg <
E) None of These
  • 7. 7. What method saves the workbook to a file?
A) export("file.xlsx")
B) close("file.xlsx")
C) save("file.xlsx") <
D) write("file.xlsx")
E) None of These
  • 8. 8. How do you iterate over all rows?
A) for row in ws.rows():
B) for row in ws.iter_rows(): <
C) for row in ws.loop_rows():
D) None of These
E) for row in ws.allrows():
  • 9. 9. Which object represents a single sheet in OpenPyXL?
A) None of These
B) Worksheet <
C) Cell
D) Workbook
E) Row
  • 10. 10. What function creates the main application window?
A) Tk() <
B) Main()
C) Root()
D) Window()
E) None of These
  • 11. 11. What does root.mainloop() do?
A) None of These
B) Closes the window
C) Runs only once
D) Loads external files
E) Keeps the window open and listens for events <
  • 12. 12. What function is used to open an existing Excel workbook?
A) load_workbook() <
B) open_excel()
C) None of These
D) excel_load()
E) read_file()
  • 13. 13. How do you read data from a cell?
A) ws["A1"].value <
B) ws.read("A1")
C) None of These
D) ws.fetch("A1")
E) ws.get("A1")
  • 14. 14. Which attribute gives the maximum number of rows used?
A) None of These
B) ws.length
C) ws.max row <
D) ws.rows
E) ws.rowcount
  • 15. 15. What is OpenPyXL used for?
A) Web scraping
B) Working with Excel files in Python <
C) Connecting to databases
D) Creating PDFs
E) None of These
  • 16. 16. How do you make a column heading bold in OpenPyXL?
A) Use Style(bold=True)
B) Use Font(bold=True) <
C) Use Header(bold=True)
D) None of These
E) Use Text(bold=True)
  • 17. 17. Which OpenPyXL function reads all cells in a row?
A) None of These
B) get_row()
C) loop_rows()
D) rows()
E) iter_rows() <
  • 18. 18. Which attribute gives the maximum number of columns used?
A) ws.cols
B) ws.width
C) None of These
D) ws.max_column <
E) ws.colcount
  • 19. 19. What do you call the top-level window in Tkinter?
A) None of These
B) Tk() <
C) Main()
D) Shell()
E) Frame()
  • 20. 21. What file type does OpenPyXL NOT support?
A) .CSV
B) .xls <
C) None of These
D) .xlsm
E) .xltx
  • 21. 22. Which widget allows single-line text input?
A) Label()
B) None of These
C) Entry() <
D) Text()
E) Button()
  • 22. 23. What method is used to place widgets using absolute positioning?
A) place() <
B) None of These
C) grid()
D) align()
E) pack()
  • 23. 25. What function is used to clear all contents of a Text widget?
A) None of These
B) remove()
C) clear()
D) delete("1.0", END) <
E) reset()
  • 24. 27. What function opens a file dialog to select a file?
A) askfile()
B) browse()
C) filedialog.askopenfilename() <
D) None of These
E) selectfile()
  • 25. 28. Which widget is used to display images?
A) Label() with Photolmage <
B) Canvas()
C) Text()
D) Button()
E) None of These
  • 26. 29. How do you write data to a cell?
A) None of These
B) ws.set("A1", "Hello")
C) ws.put("A1", "Hello")
D) ws["A1"] = "Hello" <
E) ws.cell("A1").write("Hello")
  • 27. 30. How do you change the window title?
A) root.title("My App") <
B) None of These
C) root.caption("My App")
D) root.name("My App")
E) root.text("My App")
  • 28. 31. Which Tkinter widget can be used to make a scrollable text box?
A) Label()
B) Canvas()
C) Entry()
D) None of These
E) Text() with Scrollbar() <
  • 29. 32. What is the file extension for Excel workbooks used in OpenPyXL?
A) .CSV
B) .xlsx <
C) None of These
D) .txt
E) .xls
  • 30. 33. Which method arranges widgets in rows and columns?
A) pack()
B) layout()
C) grid() <
D) None of These
E) place()
  • 31. 34. What parameter in Button() defines the action when clicked?
A) function
B) event
C) None of These
D) command <
E) onClick
  • 32. 35. Which method merges cells?
A) ws.combine("A1:B1")
B) ws.join("A1:B1")
C) ws.merge("A1:B1")
D) None of These
E) ws.merge_cells("A1:B1") <
  • 33. 36. Which method creates a new Excel workbook?
A) Excel()
B) NewExcel()
C) Workbook() <
D) CreateBook()
E) None of These
  • 34. 37. How do you insert a new row at the top?
A) None of These
B) ws.new_row(1)
C) ws.insert_rows(1) <
D) ws.top_row()
E) ws.add_row(1)
  • 35. 38. What event triggers when a Tkinter button is clicked?
A) click()
B) event()
C) command <
D) onPress()
E) None of These
  • 36. 39. To automatically update Excel when a button is pressed, which command is used?
A) Menu run-function_name
B) None of These
C) Entry onChange=function_name
D) Label text=function_name
E) Button command=function_name <
  • 37. 40. What library must be imported for Treeview?
A) from tkinter import tree
B) import view
C) from tkinter import ttk <
D) None of These
E) import tree
  • 38. 41. How do you get all sheet names?
A) wb.names
B) wb.sheetnames <
C) wb.list()
D) None of These
E) wb.sheets()
  • 39. 42. Which command imports the OpenPyXL module?
A) from openxi import *
B) import pyexcel
C) import openpyxi <
D) None of These
E) from excel import *
  • 40. 43. Which Tkinter widget is ideal for entering Excel filenames?
A) Entry() <
B) Frame()
C) Label()
D) Text()
E) None of These
  • 41. 44. What parameter in Label() sets the displayed text?
A) value
B) text <
C) label
D) caption
E) None of These
  • 42. 46. How do you show a success message after saving a file?
A) print("Saved")
B) messagebox.showinfo() <
C) None of These
D) alert()
E) label.set()
  • 43. 48. What widget is used to display text or labels?
A) Label() <
B) Text()
C) Entry()
D) None of These
E) Canvas()
  • 44. 49. How do you get a specific sheet by name?
A) wb.get("Sheet1")
B) wb["Sheet1"] <
C) wb.sheet("Sheet1")
D) None of These
E) wb.active("Sheet1")
  • 45. 50. Which module provides styling tools in OpenPyXL?
A) openpyxl.color
B) openpyxl.styles <
C) openpyxl.design
D) None of These
E) openpyxl.format
  • 46. 52. Which widget allows users to select from a list of options?
A) None of These
B) Choice()
C) Menu()
D) Combo()
E) Listbox() <
  • 47. 53. Which function closes a workbook?
A) wb.end()
B) wb.stop()
C) None of These
D) wb.finish()
E) wb.close() <
  • 48. 54. How can you disable an Entry widget after saving data?
A) entry.freeze()
B) entry.off()
C) entry.config(state="disabled") <
D) entry.hide()
E) None of These
  • 49. 55. How do you reopen a workbook after saving in OpenPyXL?
A) None of These
B) load_workbook("file.xlsx") <
C) read_workbook("file.xlsx")
D) get_book("file.xlsx")
E) wb.open("file.xlsx")
  • 50. 21. What file type does OpenPyXL NOT support?
A) .CSV
B) .xls <
C) .xlsm
D) .xltx
E) None of These
Created with That Quiz — where a math practice test is always one click away.