Question: Problem 4: Write a program that loads data from a file called my_car.json. If the file doesn't exist or there is no data in it,
Problem 4:
Write a program that loads data from a file called my_car.json. If the file doesn't exist or there is no data in it, prompt the user to enter the model of the car they drive and store it in my_car.json using json.dump().
If the file exists and there's data in it, print out the contents of the file using json.load(). Then, ask the user if they'd like to change the model of the car they drive. If they would, ask the user for the new car model information and store it in my_car.json using json.dump().
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
