Question: use python. i dont understand anything so please help me. # read_temp_file.py while True: try: in_name = input(Temperature anomaly filename:) fhand = open(in_name) break except:

use python. i dont understand anything so please help me.  use python. i dont understand anything so please help me. #
# read_temp_file.py
while True:
try:
in_name = input("Temperature anomaly filename:")
fhand = open(in_name)
break
except:
print("Could not open",in_name)
print("Analyzing", in_name)
for i in range(5):
fhand.readline()
for line in fhand:
line = line.strip()
(year, temp) = line.split(",")
year = int(year)
temp = float(temp)
print(year,temp)
fhand.close()
above is the code and here is the pic.
read_temp_file.py while True: try: in_name = input("Temperature anomaly filename:") fhand = open(in_name)
this is the NorCal data
break except: print("Could not open",in_name) print("Analyzing", in_name) for i in range(5): fhand.readline()
for line in fhand: line = line.strip() (year, temp) = line.split(",") year
= int(year) temp = float(temp) print(year,temp) fhand.close() above is the code and
here is the pic. this is the NorCal data The first step
of this analysis will be to get a window size parameter k
from the user. The window size must be a positive integer no

The first step of this analysis will be to get a window size parameter k from the user. The window size must be a positive integer no greater than 60. Start a new program temp_win1.py from your working version of read_temp_file.py from HW4. The program that reads and prints the temperature file after obtaining the filename from the user. After you have confirmed that your program is reading the temperature data from the file, you can comment out the print statement in the loop that prints the year and temperature to the screen. We have posted a solution to read_temp_file.py, if you were unable to complete it. After the program has successfully opened the file specified by the user, it will then need to obtain the window size parameter. Write a loop that asks the user for the window size parameter. Enter an integer between 0 and 60: If the user enters something that cannot be converted to an integer your program will print Enter an integer. If the user enters an integer out of range it will print Enter an integer up to 60. and you will ask for the window parameter again. Your finished program should behave as follows. Temperature anomaly filename: NorCal-1880-2018.csv Analyzing NorCal-1880-2018.csv Enter an integer between 0 and 60:spam Enter an integer. Enter an integer between 0 and 60:99 Enter an integer up to 60. Enter an integer between 0 and 60:60 Using 60 for the window parameter. Dashboard Calendar To Do Notifications Inbox

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock 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 Databases Questions!