menu

Python Input and Output

Python Input and Output - Important Points


31. Which of the following is used to read a binary file in Python?

A. 'rb'

B. 'wb'

C. 'ab'

D. 'xb'

Discuss Work Space

Answer: option a

Explanation:

The 'rb' mode is used to read a binary file in Python.

32. Which of the following is used to write binary data to a file in Python?

A. 'rb'

B. 'wb'

C. 'ab'

D. 'xb'

Discuss Work Space

Answer: option b

Explanation:

The 'wb' mode is used to write binary data to a file in Python.

33. Which of the following is used to append binary data to a file in Python?

A. 'rb'

B. 'wb'

C. 'ab'

D. 'xb'

Discuss Work Space

Answer: option c

Explanation:

The 'ab' mode is used to append binary data to a file in Python.

34. Which function is used to read an Excel file in Python?

A. openpyxl.load_workbook()

B. openpyxl.read_excel()

C. openpyxl.write_excel()

D. D. openpyxl.dump_excel()

Discuss Work Space

Answer: option a

Explanation:

The openpyxl.load_workbook() function is used to read an Excel file in Python.

35. Which function is used to write to an Excel file in Python?

A. openpyxl.load_workbook()

B. openpyxl.read_excel()

C. openpyxl.write_excel()

D. D. openpyxl.dump_excel()

Discuss Work Space

Answer: option c

Explanation:

The openpyxl.write_excel() function is used to write to an Excel 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