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