menu

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()

Discuss Work Space

Answer: 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()

Discuss Work Space

Answer: 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()

Discuss Work Space

Answer: 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()

Discuss Work Space

Answer: 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()

Discuss Work Space

Answer: option c

Explanation:

The PyPDF2.add() function is used to write to a PDF file in Python.


Subscribe for Latest Career Trends
Subscribe Now
Use AI and ChatGPT for Career Guidance

Unlock Your Future

Join Now
Worried for Placements in 2024?

Join FAST TRACK Course

Join Now
Supercharge Your SUCCESS

Join All in One Placement Mock Tests-2024

Join Now