JSON-Based Settings Saver
Write a program that saves a dictionary of user settings to a JSON file, then loads it back and prints each setting.
What the problem means: JSON is the standard format for structured data like configuration/settings files — this exercises writing a dictionary out with json.dump() and reading it back with json.load().
Approach: build a settings dictionary from the given theme and notifications value, save it with json.dump(), then reopen and read it back with json.load().
Input: Two lines: the theme (a word), and notifications as the literal text True or False.
Output: Two lines: theme: <theme> notifications: <True or False>
dark True
theme: dark notifications: True
- notifications is exactly the text True or False.
Hint 1
json.dump(data, file) writes a Python dictionary to an open file as JSON.
Hint 2
json.load(file) reads JSON content from an open file back into a Python dictionary.
Hint 3
input().strip() == "True" converts the text "True"/"False" into an actual Python boolean.
Build a small dictionary {"theme": theme, "notifications": notifications} and hand it to json.dump(settings, file) to save it as JSON. Reopening the file and calling json.load(file) reconstructs the same dictionary, which is then printed field by field.