Answer to Question #97307 in Python for yousif

Question #97307
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
1
Expert's answer
2019-10-25T12:55:12-0400


import os

# This program has read/write access to the WORKSPACE directory
filepath = os.path.join(os.environ['PATH'],"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

Well, here it is.


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