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