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