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, 23.06.2019 00:00
Which is the correct sequence of steps to set up a document in landscape orientation? a. select page setup from the file menu. then click the margins tab and select landscape. b. select page setup from the edit menu. then click the margins tab and select landscape. c. select page setup from the insert menu. then click the margins tab and select landscape. d. select page setup from the format menu. then click the margins tab and select landscape
Answers: 1
question
Computers and Technology, 23.06.2019 07:30
To check spelling errors in a document, the word application uses the to determine appropriate spelling. internet built-in dictionary user-defined words other text in the document
Answers: 2
question
Computers and Technology, 23.06.2019 12:40
According to the video what are some tasks petroleum engineers perform check all that apply
Answers: 2
question
Computers and Technology, 23.06.2019 22:30
Lakendra finished working on her monthly report. in looking it over, she saw that it had large blocks of white space. what steps could lakendra take to reduce the amount of white space?
Answers: 3
You know the right answer?
The Weather Create a program that:
Imports and opens a file
Appends additional data to...
Questions
question
English, 12.12.2019 00:31
Questions on the website: 13722361