Python - Structured Data Files
What will be the output of this code?
import json
person = {'name': 'Anna', 'age': 25}
json_str = json.dumps(person)
print(type(json_str))What will be the output of this code?
import json
person = {'name': 'Anna', 'age': 25}
json_str = json.dumps(person)
print(type(json_str))json.dumps() converts a Python dict to a JSON formatted string.json_str is a string, so type(json_str) is <class 'str'>.15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions