Python Input and Output
Python Input and Output - Important Points
36. | Which of the following is used to create a new sheet in an Excel file using openpyxl? |
---|
A. workbook.create_sheet()
B. workbook.new_sheet()
C. workbook.add_sheet()
D. D. workbook.append_sheet()
View Answer Discuss Work SpaceAnswer: option a
Explanation:
The workbook.create_sheet() method is used to create a new sheet in an Excel file using openpyxl.
37. | Which of the following is used to write data to a cell in an Excel sheet using openpyxl? |
---|
A. sheet.cell()
B. sheet.write()
C. sheet.append()
D. D. sheet.update()
View Answer Discuss Work SpaceAnswer: option a
Explanation:
The sheet.cell() method is used to write data to a cell in an Excel sheet using openpyxl.
38. | Which of the following is used to save changes to an Excel file using openpyxl? |
---|
A. workbook.save()
B. workbook.write()
C. workbook.update()
D. D. workbook.append()
View Answer Discuss Work SpaceAnswer: option a
Explanation:
The workbook.save() method is used to save changes to an Excel file using openpyxl.
39. | Which function is used to read a PDF file in Python? |
---|
A. PyPDF2.read()
B. PyPDF2.load()
C. PyPDF2.open()
D. D. PyPDF2.extract()
View Answer Discuss Work SpaceAnswer: option a
Explanation:
The PyPDF2.read() function is used to read a PDF file in Python.
40. | Which function is used to write to a PDF file in Python? |
---|
A. PyPDF2.write()
B. PyPDF2.save()
C. PyPDF2.add()
D. D. PyPDF2.append()
View Answer Discuss Work SpaceAnswer: option c
Explanation:
The PyPDF2.add() function is used to write to a PDF file in Python.