Python: getting started

Lesson 08 · 12 min

JSON and a simple request

json.loads reads a string. A network response is bytes/text, then parsing. Check the keys.

json.loads(text) → a dict/list. json.dumps(obj) back into a string. Network: urllib from the standard library or requests. The response doesn't have to be what you expect: if a key is missing use .get; don't crash the whole file without a message.

Sign in to continue

The rest of this lesson opens after sign up

The first lesson of every course is open without an account. To read on, solve the practice and use Ask, create a free account or log in.