I am a beginner in Python. Python 3.7.6
import json
fil='numbers.json'
num=[]
with open(fil,'r') as file :
for obj in file :
num.append(json.load(obj))
print(num)
This is the JSON file :
"45""56""78""75"
This is the error I am getting while running the code
Traceback (most recent call last):
File "C:/Users/Dell/PycharmProjects/untitled/tetu.py", line 6, in <module>
num.append(json.load(obj))
File "C:\Users\Dell\AppData\Local\Programs\Python\Python38\lib\json\__init__.py", line 293, in load
return loads(fp.read(),
AttributeError: 'str' object has no attribute 'read'
Any idea how I can fix this?
Thanks in advance