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