Question: this is a python sample so i need a python program to print and write to the output file the average temperature of the year

 this is a python sample so i need a python program
this is a python sample
to print and write to the output file the average temperature of
so i need a python program to print and write to the output file the average temperature of the year
the year this is like an example of the final output #this is like an example of the final output

# Read and process data from a file. #import os import tkinter as tk from tkinter.filedialog import * #- # input file fn_in = as kopenfilename (title="Select input file", filetypes=[(**.TXT", "*.txt") fin = open(fn_in, ".") # output file fn_out = asksaveasfilename (title="Select output file", filetypes=[(".TXT", ". f_out open(fn_out, "W") line_list fin.readlines () for line in line. list: S - line.split() month, temp int (s[0]), float (s[-11) print (month, temp) f_out.write(str (month) + '\t' + str(temp) + ' ') fin.close() f out.close() I Download and run the following program: Extract Month Temp-001.Ry. Here are some files with sample data: temp data 1995.txt a temp data 1996.txt temp data 1997.txt temp data 1998.txt Modify the program to print and write to the output file the average temperature for the year. temp_data_1995 temp_data_average_1995 1 1 43.1 2 2 40.4 3 3 26.9 4 4 30.6 5 5 20.4 6 6 25.3 7 7 38.7 8 8 34.7 9 9 32.1 10 10 28.9 11 11 30.0 12 12 34.5 13 13 46.8 14 14 53.5 15 15 56.6 16 16 56.6 17 17 51.7 18 43.8 19 19 40.1 20 20 43.7 21 21 42.0 22 22 34.8 23 23 32.6 24 24 35.1 25 Average temperature: 26 38.45

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!