From 1c3969d34893c30bd18705107ac4f650f5f225fb Mon Sep 17 00:00:00 2001 From: erbrown Date: Sun, 14 Dec 2025 09:35:01 -0500 Subject: [PATCH] Checkpoint 2: Each system takes inputs, performs processsing and produces an output in return. The three different scales are composed of smaller components that work together to complete a specific task. It is really cool how everythiing works together to form a whole. Errors may arise within the three different scales that must be fixed in order for it to run properly. --- weather/weather.py | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/weather/weather.py b/weather/weather.py index 75fd2f6..2853d29 100644 --- a/weather/weather.py +++ b/weather/weather.py @@ -21,4 +21,28 @@ 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: + lct = geocode_location(location) + show_lct =location + else: + lct = estimate_location() + show_lct = "Estimate location" + weatheroffice = get_weather_office(lct['lat'],lct['lng']) + if not weatheroffice: + print("Unable to find weather office data") + forecast = get_forecast(weatheroffice['office'],weatheroffice['x'],weatheroffice['y'], metric = metric) + if not forecast: + print('Unable to find forecast data') + print(f"Location: {show_lct if location else estimate_location()}\n ______________ \n") + for period in forecast: + print(f"{period['name']}") + print(f"Description: {period['description']}") + print(f"Temperature: {period['temperature']}{'C' if metric else 'F'}") + if verbose: + print(f"Wind Direction: {period['wind_direction']}") + print(f"Wind Speed: {period['wind _speed']}\n") + + + # print("Not finished...") # YOUR CODE HERE! + # print(location)