Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

use python. I just need to how to start it. I have an example Use python, the black background picture is an example. I just

image text in transcribeduse python. I just need to how to start it. I have an exampleimage text in transcribedUse python, the black background picture is an example. I just dont know how to start it.

Download the temperature anomaly data files for our region from the Code directory on Canvas: NorCal-1880-2018.csv. The first step will be to get the filename from the user and open it for reading. If your program can not open the file, because the user misspelled it or it is in the wrong directory, your program should not crash. Instead it will just ask for the file again. Once the file has been successfully opened for reading, your program will print a message including the name of the opened file. Here is an example transcript of how your program should work. User input is shown in black while the Python program output is in blue. Temperature anomaly filename: spam! Could not open spam! Temperature anomaly filename: NorCal-1880-2018.csv Analyzing NorCal-1880-2018.csv Submit the completed program to gradescope as open_temp_file.py # get filename from user filename = input("Enter input filename: "); # open input filehandle infile = open(filename) # while loop reads numbers from the file while True: in str = infile.readline (), # done reading file when we see an empty input if in str == "": break # strip whitespace from end of input string in_str = in_str.strip(), # convert to floating point in num = float(in_str)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions