File I/O & Exception Handling
# Context Manager automatically closes file handle upon exit
try:
with open("config.json", "r", encoding="utf-8") as f:
data = f.read()
print("Config loaded successfully!")
except FileNotFoundError:
print("Warning: config.json not found, using default values.")
except Exception as e:
print(f"Unexpected error: {e}")