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