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