Answered step by step
Verified Expert Solution
Question
1 Approved Answer
The program must give them the option and I will test both. For city you should ask the user to enter a state, otherwise, there's
The program must give them the option and I will test both. For city you should ask the user to enter a state, otherwise, there's no way to distinguish between Omaha TX, Omaha AR, and Omaha NE.
- Validate whether the user entered valid data. If valid data isn't presented notify the user. Your program should never crash with bad user input
- request weather forecast data from OpenWeatherMap.
- Use the Requests library in order to request data from the web service.
- Make a connection to the API using the Requests library.
- Use Try blocks to ensure that your request was successful. If the connection was not successful display a message to the user.
- Use try blocks when establishing connections to the web service. You must print a message to the user indicating whether or not the connection was successful.
- ask the user which they want to perform with each iteration of the program.
- Allow the user to run the program multiple times to allow them to look up weather conditions for multiple locations.
- must GEO Lookup first then weather lookup using the latitude and longitude. This will require you to do 2 API calls. One call will be to obtain the LAT and LON and the other will be to get the weather using the LAT and LON.
- READ all of the OpenWeather GEOCode and Weather Lookup API documentation. Most of the questions you have can be answered by the API documentation.
Display the weather information in a READABLE format to the user in Celsius and Fahrenheit
API Key http://openweathermap.org/appid
My key: 89dac574b137de87ab6b6a6f026019e0
Step by Step Solution
★★★★★
3.47 Rating (154 Votes )
There are 3 Steps involved in it
Step: 1
Answer Below is the Python code implementing the described functionality import requests def getweat...Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started