Verified
Correct Answer
with open('data.json', 'w', encoding='utf-8') as f:
json.dump(data, f, indent=2)
with open('data.json', 'w', encoding='utf-8') as f:
json.dump(data, f, indent=2)
Additional Explanation
json.dump Python object को file में लिखता है।