What is the difrence between:
s1 = '["a"]'s2 = "['a']"
When I do json.loads, I get following error for s2 but s1 is fine:
>>> s1='["a2"]'
>>> s2="['a2']"
>>> json.loads(s1)
[u'a2']
>>> json.loads(s2)
raise ValueError("No JSON object could be decoded")
ValueError: No JSON object could be decoded
json, but does the method require specific input string format?NameError, because you defines1twice, but you define nos2. Please correct your code so it shows exactly what you saw.