Created
November 23, 2017 23:21
-
-
Save denolayanbule/821790c25e7bdd699f8d4c4c6157df71 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
#Allows us to take the city name from the user | |
city = input('Which city would you like to know the weather for ?: ') | |
url = "http://api.openweathermap.org/data/2.5/weather?appid=fc121d2e5a701f5309e46aa3e75cb8eb&q=" + city | |
json_data = requests.get(url).json() | |
#print(json_data) | |
formatted_data = json_data["weather"][0]['main'] | |
print(formatted_data.upper()) | |
print("Thank you for using the weather API") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment