Skip to content

PK-SS/Weather-of-city-with-the-help-of-html-css

Repository files navigation

Weather-of-city-with-the-help-of-html-css

Enter the city name to know the weather

We are going to get the weather of a city using OpenWeatherMap API. To use the OpenWeatherMap API, we have to get the API key. We will get it by creating an account on their website. We need requests module for the HTTP requests and JSON module to work with the response. Follow the below steps to get the weather of any city:

->Import the requests and JSON modules.

->Initialize the base URL of the weather API.

->Initialize the city and API key.

->Update the base URL with the API key and city name.

->Send a get request using the requests.get() method.

->And extract the weather info using the JSON module from the response.

image

About

Enter the city name to know the weather

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published