Instructions

  • 1. Your final score will reflect your grasp of the concepts—approach each question with precision.
  • 2. Thoroughly review each solution before proceeding to ensure full understanding.
  • 3. Final results will be available after submission to provide insights into areas for further improvement.
  • 4. Maintain academic integrity—plagiarism undermines learning and professional growth.
  • 5. Once submitted, responses are final, so ensure you’re confident in your answers.
  • 6. These challenges are designed to test practical knowledge; apply your skills as you would in real-world scenarios.

All Problems

Question

Action

Which module is used to handle JSON files in Python?

View

What does json.dump() do?

View

How do you load a JSON object from a file?

View

Which function converts a JSON string to a Python object?

View

What is the default encoding for JSON files in Python?

View

How do you pretty-print JSON data while writing it to a file?

View

Which data type is not supported in JSON?

View

What will json.loads() return if the JSON is invalid?

View

How do you convert a Python dictionary to a JSON string?

View

What happens if you try to write non-serializable data to a JSON file?

View

Which module is used to handle JSON files in Python?

json
csv
os
pickle

What does json.dump() do?

Writes Python object to a JSON file
Reads a JSON file into memory
Deletes a JSON file
Appends data to a JSON file

How do you load a JSON object from a file?

json.load()
json.read()
json.write()
json.loads()

Which function converts a JSON string to a Python object?

json.loads()
json.load()
json.convert()
json.read()

What is the default encoding for JSON files in Python?

UTF-8
ASCII
UTF-16
Binary

How do you pretty-print JSON data while writing it to a file?

Use indent parameter in json.dump()
Call pretty() method
Use format=True
It is not possible

Which data type is not supported in JSON?

set
list
dictionary
string

What will json.loads() return if the JSON is invalid?

JSONDecodeError
ValueError
TypeError
IOError

How do you convert a Python dictionary to a JSON string?

json.dumps()
json.dump()
json.to_string()
str()

What happens if you try to write non-serializable data to a JSON file?

TypeError
ValueError
FileNotFoundError
IOError