Skip to content

Commit

Permalink
added city and state printing
Browse files Browse the repository at this point in the history
  • Loading branch information
rBigChill committed May 27, 2024
1 parent d35bc85 commit 0fd2417
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions printWeather.py
Original file line number Diff line number Diff line change
Expand Up @@ -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']
Expand Down

0 comments on commit 0fd2417

Please sign in to comment.