generated from mwc/lab_weather
yay!
This commit is contained in:
@@ -21,4 +21,20 @@ def print_weather(location=None, metric=False, verbose=False):
|
||||
When metric is True, prints out the weather in metric units.
|
||||
When verbose is True, prints out a more detailed report.
|
||||
"""
|
||||
print("Not finished...") # YOUR CODE HERE!
|
||||
if location:
|
||||
coordinates = geocode_location(location)
|
||||
else:
|
||||
coordinates = estimate_location()
|
||||
|
||||
office = get_weather_office(coordinates["lat"], coordinates["lng"])
|
||||
|
||||
forecast = get_forecast(office["office"], office["x"], office["y"], metric=metric)
|
||||
#print(forecast) # YOUR CODE HERE!
|
||||
for day in forecast:
|
||||
display = day["name"] +":"+ day["description"] + " with a high of " + str(day["temperature"]) + "."
|
||||
print(display)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user