Skip to content

Commit 82b78cb

Browse files
authored
Merge pull request #21 from itkhld1/patch-1
Update city_weather.py
2 parents 03c270f + a7df721 commit 82b78cb

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

exercises/city_weather.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@
44
import json
55
from datetime import datetime
66

7+
# asking the user for api key
8+
api_key = input("Please Enter Your API: ")
9+
10+
#asking the user for city name
11+
city_name = input("Please Enter Your City Name: ")
12+
713
# Register yourself here and get the API key first: openweathermap.org
814
# API Key would be something like this: 2f8b2c69352e89120becd33028a1c986
915
# We have to call Current weather data API: https://openweathermap.org/current (There are many APIs there)
@@ -16,12 +22,6 @@ def time_from_utc_with_timezone(utc_with_tz):
1622
local_time = datetime.utcfromtimestamp(utc_with_tz)
1723
return local_time.time()
1824

19-
# Enter your API key
20-
api_key = ""
21-
22-
# Get city name from user
23-
city_name = input("Enter city name : ")
24-
2525
# API url
2626
weather_url = 'http://api.openweathermap.org/data/2.5/weather?q=' + city_name + '&appid='+api_key
2727

0 commit comments

Comments
 (0)