Suppose you have a dictionary in python say my_dict = {'a':11,'b':22,'c':33}. Refer to the following code -
import json
my_dict = {'a':11,'b':22,'c':33}
with open("your_json_file", "w") as fp:
json.dump(a,fp)
json.dumps is mainly used to display dictionaries as a json format with the type of string. While dump is used for saving to file
Hope this helps!!
If you need to learn more about Python, It's recommended to join Python Training today.
Thanks!