What’s the temperature in the Rovaniemi right now?
Let’s find it out with Python.
Your task for this project is to create a Python program that gets any city name as input and outputs the current temperature for that city.
When the program is executed, the terminal asks the user to enter a city. Once the user enters the city, the program outputs the temperature of that city as shown in the demo below.
- Install the required libraries with: pip install requests
- Create a free account and get an API key from https://openweathermap.org
- Run the app with python main.py
Learn how to make an API GET request by city for Open Weather API: https://openweathermap.org/current#cityid
Learn how to use the Python requests library: https://pythonhow.com/how/requests-object/
Source: Daily Python Projects: https://dailypythonprojects.substack.com