From 0fd2417720102c588a503a54d11796141773e656 Mon Sep 17 00:00:00 2001 From: Jorge Cisneros Date: Mon, 27 May 2024 16:23:20 -0500 Subject: [PATCH] added city and state printing --- printWeather.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/printWeather.py b/printWeather.py index 8d6e3de..2288956 100644 --- a/printWeather.py +++ b/printWeather.py @@ -15,6 +15,11 @@ def __init__(self): WEBSITE = "https://api.techniknews.net/ipgeo/" data = requests.get(WEBSITE) json = data.json() + city = json['city'] + state = json['regionName'] + self.cityInfo = f'{city}, {state}' + + print(f'\n\tWeather for {self.cityInfo}') self.lat = json['lat'] self.lon = json['lon']