Error while opening json file

I am getting this error while trying to open json file using json.load


JSONDecodeError Traceback (most recent call last)
in
1 with open(‘data.json’,‘r’) as file:
----> 2 d = json.load(file)
3 print(d)

~\Anaconda3\lib\json_init_.py in load(fp, cls, object_hook, parse_float, parse_int, parse_constant, object_pairs_hook, **kw)
294 cls=cls, object_hook=object_hook,
295 parse_float=parse_float, parse_int=parse_int,
–> 296 parse_constant=parse_constant, object_pairs_hook=object_pairs_hook, **kw)
297
298

~\Anaconda3\lib\json_init_.py in loads(s, encoding, cls, object_hook, parse_float, parse_int, parse_constant, object_pairs_hook, **kw)
346 parse_int is None and parse_float is None and
347 parse_constant is None and object_pairs_hook is None and not kw):
–> 348 return _default_decoder.decode(s)
349 if cls is None:
350 cls = JSONDecoder

~\Anaconda3\lib\json\decoder.py in decode(self, s, _w)
335
336 “”"
–> 337 obj, end = self.raw_decode(s, idx=_w(s, 0).end())
338 end = _w(s, end).end()
339 if end != len(s):

~\Anaconda3\lib\json\decoder.py in raw_decode(self, s, idx)
353 obj, end = self.scan_once(s, idx)
354 except StopIteration as err:
–> 355 raise JSONDecodeError(“Expecting value”, s, err.value) from None
356 return obj, end

JSONDecodeError: Expecting value: line 4 column 17 (char 70)

Hi @sanchit123manchanda,

This error usually arises when the JSON is not valid. Share the file you’re trying to load with me and I’ll validate it for you.

{
“Name” : “Sanchit Manchanda”,
“marks” : 90,
“subjects”:[‘eng’,‘maths’]

}

this is the content of the file

This is not valid JSON.
You can verify it yourself at this link.

The same code was written in te video.

{
"Name": "Sanchit Manchanda",
"marks": 90,
"subjects": ["eng", "maths"]
}

Here. Try this json.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.