subject

The Weather Create a program that:
Imports and opens a file
Appends additional data to a file
Reads from the file to displays each city name and month average high temperature in Celsius

Output: The output should resemble the following

City of Beijing month ave: highest high is 30.9 Celsius
City of Cairo month ave: highest high is 34.7 Celsius
City of London month ave: highest high is 23.5 Celsius
City of Nairobi month ave: highest high is 26.3 Celsius
City of New York City month ave: highest high is 28.9 Celsius
City of Sydney month ave: highest high is 26.5 Celsius
City of Tokyo month ave: highest high is 30.8 Celsius
City of Rio De Janeiro month ave: highest high is 30.0 Celsius

All of the above text output is generated from the file. Only these strings are hard coded:

"is"
"of"
"Celsius"

Import the file into the Jupyter Notebook environment
Use !curl to download https://raw. githubusercontent. com/MicrosoftLearning/intropython/m aster/world_temp_mean. csv as mean_temp. txt
# [ ] The Weather: import world_mean_team. csv as mean_temp. txt into the Jupyter notebook

Add the weather for Rio
Open the file in append plus mode ('a+')
Write a new line for Rio de Janeiro "\nRio de Janeiro, Brazil,30.0,18.0"
Grab the column headings
Use .seek() to move the pointer to the beginning of the file
Read the first line of text into a variable called: headings
Convert headings to a list using .split(',') which splits on each comma
# [ ] The Weather: open file, read/print first line, convert line to list (splitting on comma)

Read the remaining lines from the file using a while loop
Assign remaining lines to a city_temp variable
Convert the city_temp to a list using .split(',') for each .readline() in the loop
Print each city & the highest monthly average temperature
Close mean_temps
>Tips & Hints:

Print headings to determine indexes to use for the final output (what is in headings[0], [1], [2]..?)
The city_temp data follows the order of the headings (city_temp[0] is described by headings[0])
The output should look like: "month ave: highest high" for Beijing is 30.9 Celsius
Convert city_temp to lists with .split(',')
# [ ] The Weather: use while loop to print city and highest monthly average temp in celsius

# [] create The Weather

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 13:30
Write lines of verse that rhyme to remember the following information: acid rain is a type of air pollution caused by chemicals in the air.
Answers: 1
question
Computers and Technology, 23.06.2019 08:00
Michael has written an e-mail to his employees that describes a new product special that will be introduced to the customers next week. by taking time to make sure the e-mail is well written, logical, and organized, michael has made sure his message has the characteristics of a) effective communicationb) ineffective communicationc) barriers to communicationd) workplace communication
Answers: 2
question
Computers and Technology, 23.06.2019 15:30
Brian wants to conduct an online search with a certain phrase. he intends to use the words books that belong to the 1800s in his search. how should he use the word that in his search?
Answers: 1
question
Computers and Technology, 23.06.2019 16:00
Helen is having a meeting with her colleagues in her company. they are working on the goals and objectives for the coming year. they want to ensure that these goals and objectives of the processes involved are properly evaluated. which system can helen and her colleagues apply to evaluate this? helen and her colleagues require a blank to evaluate the goals and objectives.
Answers: 2
You know the right answer?
The Weather Create a program that:
Imports and opens a file
Appends additional data to...
Questions
question
Mathematics, 23.10.2020 08:01
question
English, 23.10.2020 08:01
question
Mathematics, 23.10.2020 08:01
question
Mathematics, 23.10.2020 08:01
Questions on the website: 13722367