Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Earthquake Classwork #5

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

yihuitong00
Copy link

Answers UCL-COMP0233-2022-2023/RSE-Classwork#13

The strongest earthquake was at ([-2.15, 52.52], [-0.332, 53.403]) with magnitude 4.8.

Difficulty: sometimes got an error "string indices must be integers".

@chongfengling
Copy link

# 下面不行因为 string indices must be integers with open('response.json', 'r') as f: d=f.read() print(d) def get_data(): return d["features"]
this is because d is a str rather dict, so you can not get keys or values from a str.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants