menu

Python Input and Output

Python Input and Output - Important Points


26. Which function is used to read a JSON file in Python?

A. json.read()

B. json.load()

C. json.write()

D. D. json.dump()

Discuss Work Space

Answer: option b

Explanation:

The json.load() function is used to read a JSON file in Python.

27. Which function is used to write to a JSON file in Python?

A. json.write()

B. json.load()

C. json.dump()

D. D. json.read()

Discuss Work Space

Answer: option c

Explanation:

The json.dump() function is used to write to a JSON file in Python.

28. Which of the following is used to read binary data from a file in Python?

A. read()

B. readline()

C. readlines()

D. D. None of the above

Discuss Work Space

Answer: option a

Explanation:

The read() method is used to read binary data from a file in Python.

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

A. write()

B. writelines()

C. append()

D. D. None of the above

Discuss Work Space

Answer: option a

Explanation:

The write() method is used to write binary data to a file in Python.

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

A. write()

B. writelines()

C. append()

D. D. None of the above

Discuss Work Space

Answer: option c

Explanation:

The append() method is used to append binary data to a 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