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