Program - Writing JSON to a file


Topic: Program - Writing JSON to a file

Solution

import json
person_dict = {"name": "Bob",
"languages": ["English", "Fench"],
"married": True,
"age": 32
}
with open('person.txt', 'w') as json_file:
  json.dump(person_dict, json_file)



List all Python Programs