Question: In Python with the given code, import requests import json def printResults(data): # Use the json module to load the string data into a dictionary

In Python with the given code,

import requests import json def printResults(data): # Use the json module to load the string data into a dictionary theJSON = json.loads(data) #################################################################### # DO NOT CHANGE CODE ABOVE THIS LINE #################################################################### # output the number of events # for each event, print the place where it occurred # print the events that only have a magnitude greater than 4 # print only the events where at least 1 person reported feeling something #################################################################### # DO NOT CHANGE CODE BELOW THIS LINE #################################################################### def main(): urlData = "https://earthquake.usgs.gov/earthquakes/feed/v1.0/summary/2.5_day.geojson" web = requests.get(urlData) if web.status_code == 200: printResults(web.content) else: print('There was an HTTP error with the request') if __name__ == "__main__": main()

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!