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