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