# Writing dictionary as json import json d = {'guitar':'Jerry', 'drums':'Mickey' } json.dump(d, open('1.json', 'w'))