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