Copy and paste the following code into the Solve tab. It will take data from input and put it into a file. Use the filepath variable to open the file and solve this problem.
import os
# This program has read/write access to the WORKSPACE directory
filepath = os.path.join( os.environ['WORKSPACE'], 'NewYorkTemps.txt' )
# The testing system will let this program know how many lines to expect
num_of_lines = int( input() )
# Copy input into the file. Do not modify!
with open( filepath, 'w' ) as file:
for _ in range( num_of_lines ):
file.write( input() + '\n' )
# Write your program below
file = open(filepath, 'r')
Write a program to find the average of the numbers stored in NewYorkTemps.txt. Be sure your output uses floating point numbers (i.e. numbers with decimals).
1
Expert's answer
2019-10-24T00:57:08-0400
Dear yousif, your question requires a lot of work, which neither of our experts is ready to perform for free. We advise you to convert it to a fully qualified order and we will try to help you. Please click the link below to proceed: Submit order
Comments
Leave a comment