my code
import simplejson as json
import os
if os.path.isfile("./ages.json") and os.stat("./ages.json") != 0:
old_file = open("./ages.json","r+")
data = json.loads(old_file.read())
print("Current age is ", data["age"])
data[0]["age"] = data[0]["age"] + 1
print("New age ",data[0]["age"])
else:
old_file = open("./ages.json","w+")
data = {"Name":"nick","age":14}
print("No age detacted .setting default age to",data[0]["age"])
old_file.seek(0)
old_file.write(json.dumps(data))
error-
simplejson.errors.JSONDecodeError: Expecting value: line 1 column 1 (char 0)