Subject: Python turns JSON string to JSON – what’s the best way to do this?
Hey everyone!
I’m kinda new to Python and trying to figure out how python turns json string to json. Like, I have this JSON string from an API, but I need to work with it as a dict or list in Python.
I’ve seen `json.loads()` mentioned, but is that the *best* way? Or are there other methods?
Also, what if the string’s malformed—does it just crash? Would love a quick example if anyone’s got one!
Thanks in advance, y’all. 🙏
(PS: Sorry if this is a dumb question—still learning!)
Hey everyone!
I’m kinda new to Python and trying to figure out how python turns json string to json. Like, I have this JSON string from an API, but I need to work with it as a dict or list in Python.
I’ve seen `json.loads()` mentioned, but is that the *best* way? Or are there other methods?
Also, what if the string’s malformed—does it just crash? Would love a quick example if anyone’s got one!
Thanks in advance, y’all. 🙏
(PS: Sorry if this is a dumb question—still learning!)
