Use the dump() function from the json module to write objects in a JSON file. You will also need the open() function in write mode to create a file or overwrite an existing one.