I have following simple code,
import json
json1 = """
['Monday March 9', 'Tuesday March 3', 'Saturday March 7']
"""
x = json.loads(json1, encoding="utf-8")
I want to convert the json array string to be a list with json.loads
,
but the following error occurs:
File "D:\JsonTest4.py", line 66, in test_3
x = json.loads(json1, encoding="utf-8")
File "d:\mypython\json\__init__.py", line 348, in loads
return _default_decoder.decode(s)
File "d:\mypython\json\decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "d:\mypython\json\decoder.py", line 355, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 2 column 21 (char 21)
I would like to know where the problem is, thanks!