App Aimsir

This week, we built a python Weather app. It gets the weather forecast for any city in the world that we type in, How does it work??

We first import the Requests library so we can get information from an external website

Then we create a variable called city, this will store the input that the user types in

We then print out a message along with the city name that the user typed in

Then we use the requests library to get the weather info for our city from the wttr.in website

The last thing we do is print out the result in test format.

Below is the code we wrote on my Github page

We used Thonny to write our project, once typed in, press the Green Play Button to run the code

To install the Requests Library in Thonny, go to tools > manage packages > in the search bar, type requests, click the first option and install

Previous
Previous

Fraction converter

Next
Next

Password Generator