diff --git a/weather/weather.py b/weather/weather.py index 75fd2f6..8ee95eb 100644 --- a/weather/weather.py +++ b/weather/weather.py @@ -21,4 +21,27 @@ 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 verbose: + print(location) + if location is None: + mylocation=estimate_location() + else: + mylocation=geocode_location(location) + if mylocation is None: + print("Your City Cannot Be Found") + return + if verbose: + print(mylocation) + myoffice=get_weather_office(mylocation['lat'], mylocation['lng']) + if myoffice is None: + print("There is no weather station") + return + if verbose: + print(myoffice) + myforcast=get_forecast(myoffice["office"],myoffice["x"],myoffice["y"], metric) + if verbose: + print(myforcast) + else: + print(myforcast[0]) + +