Skip to content
C

Parse a GitHub-Style API Response

Easypython

Given a JSON string that represents what a GitHub API response would look like (i.e. what response.json() would return), parse it and print the user's public repo count.

Why not a real network call? an automated judge can't reliably reach the internet, and even if it could, a live API's data changes over time — so this exercises the exact same skill (reading fields out of a parsed JSON API response) using a fixed, given response instead of a live one.

Approach: json.loads() parses the JSON string into a Python dict, exactly like response.json() would; then read the field you need.

Input: One line: a JSON object (as text) with at least a public_repos field.

Output: One line: the value of public_repos.

Input (stdin)

Output

Run your code to see output here...