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