subject

(Edhesive 9.7 Code Practice: Question 4): Using the prices. txt (Links to an external site.) data file find the average of the values in the file. Use the filepath variable to open the file and solve this problem. The starter code provided will take data from input and put it into a file.

Write Your Code
Use the embedded IDE below to write and test your code. The necessary .txt file is already loaded, so you can reference it when you work through the problem.
Note: If you'd like to do this in a new screen instead of within the embedded IDE, click "Open in Repl. it" in the top right-hand corner. This will open a new window and give you a unique link that will serve as your own file, so be sure to keep track of this link!
Write your code starting on line 14 in Repl. it.
When done, move to the next set of instructions that follow the embedded IDE below.

Check Your Code
First, copy and paste the following code into the "Solve" tab in the Sandbox:
import os

# This program has read/write access to the WORKSPACE directory
filepath = os. path. join( os. environ['WORKSPACE'], 'prices. 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
Then, copy and paste your program from Repl. it, starting at line 6, to the Sandbox, directly underneath the code you copied in step 1.
You're now ready to submit! Click "RUN."
You will be directed to the "History" tab where you can see whether or not your submission is "accepted."
If your code is "accepted," move to the next set of instructions. If your code is not "accepted," try debugging your code with the resource below and submitting it again.

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 02:30
People with high self-esteem: accept their strengths and weaknesses. believe that failed experiences are failures of their whole self. feel good about who they are only when they reach total success. need positive external experiences to counteract negative feelings that constantly plague them.
Answers: 1
question
Computers and Technology, 23.06.2019 04:10
2pointswho was mikhail gorbachev? oa. a russian leader who opposed a coupob. a polish leader who founded the labor union "solidarityoc. a soviet leader who called for a closer relationship with the unitedstates, economic reform, and a more open societyd. a soviet leader who called for more oppression in the soviet union
Answers: 3
question
Computers and Technology, 24.06.2019 02:10
Aspeed limit sign that says "night" indicates the legal speed between sunset and sunrise.
Answers: 2
question
Computers and Technology, 24.06.2019 13:00
What are some websites that you can read manga (ex: manga rock)
Answers: 1
You know the right answer?
(Edhesive 9.7 Code Practice: Question 4): Using the prices. txt (Links to an external site.) data f...
Questions
question
Mathematics, 07.09.2021 14:00
question
Mathematics, 07.09.2021 14:00
question
Mathematics, 07.09.2021 14:00
question
Mathematics, 07.09.2021 14:00
Questions on the website: 13722361