Question: 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.

  1. 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.
    1. Use the Requests library in order to request data from the web service.
    2. Make a connection to the API using the Requests library.
    3. Use Try blocks to ensure that your request was successful. If the connection was not successful display a message to the user.
    4. 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.
    5. ask the user which they want to perform with each iteration of the program.
        1.  

       Display the weather information in a READABLE format to the user  in Celsius and Fahrenheit

      1. 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.
      •  

      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

1 Expert Approved Answer
Step: 1 Unlock

Answer Below is the Python code implementing the described functionality import requests def getweat... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Operating System Questions!