Answer to Question #97227 in Python for yousif

Question #97227
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

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS