1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Romashka-Z-Leto [24]
4 years ago
15

Create a function average_temp(s) that accepts a file name s that contains temperature readings. Each line in the file contains

a date followed by 24 hourly temperature readings in a comma-separated-value format, like this example:
2/3/2016,18,17,17,18,20,22,25,30,32,32,32,33,31,28,26,26,25,22,20,20,19,18,18,18

For each line in the file, the function should print out a line containing two items: the date, then comma, then the average temperature on that date, e.g.

3/5/2018, 58.24

3/6/2018, 60.11

3/7/2018, 57.55
Computers and Technology
1 answer:
Debora [2.8K]4 years ago
3 0

Answer:

def average_temp(s): f = open("s.txt","r") for line in f: myList = line.split(",") print(myList[0],end=",") t=0 for i in range(1,25,1): t += int(myList[i]) t /= 24 print(t) f.close()

def average_temp(s):

f = open("s.txt","r")

for line in f:

myList = line.split(",")

print(myList[0],end=",")

t=0

for i in range(1,25,1):

t += int(myList[i])

t /= 24

print(t)

f.close()

Explanation:

I used Python for the solution.

You might be interested in
Which option should you select to accept a tracked change? A. Accept B. Reject C. Review D. Delete
TiliK225 [7]
Your answer that your looking for it letter A! I hope this helped c:
5 0
3 years ago
Read 2 more answers
Best free vpn to bypass geo tagging
Mamont248 [21]

Answer:

Nord VPN

Explanation:

5 0
4 years ago
1. Which of the following is not a question that should be asked when planning a Windows Server 2019 installation?
sashaice [31]

Answer:

1 B 2 C and B 3 True

Explanation:

3 0
3 years ago
Why do some people put salt on sidewalks when it snows?
drek231 [11]
It help to melt the snow quicker. they salt eats away the snow.
6 0
4 years ago
How does the movement of earth in space create cycles we all experience?
Contact [7]
Actually, humans can not feel the Earth's movement because of our atmosphere(:
5 0
4 years ago
Other questions:
  • A usability study compares the number of page visits on a web site. Half of the participants saw Version A of the home page. The
    13·1 answer
  • Spreadsheets will be displayed as tables in presentations.True or False?
    6·2 answers
  • DJ wants to see how his document will look when printed. Where would he find the button to see the document in print view?
    12·2 answers
  • Janis is preparing a financial document. She needs to use the dollar symbol placed above the number key 4. Which key will Janis
    14·1 answer
  • Split a string by string.
    6·1 answer
  • Which of the following is NOT a goal of a Material Requirements Plans (MRP)?
    12·1 answer
  • Each symbol of an octal number corresponds to 3 bits of a binary number. is it true or false​
    5·1 answer
  • Which action is applicable only to tables?
    13·1 answer
  • Where can you get information on receiving financial help?
    12·1 answer
  • Amber is a hacker who steals information when people enter their personal details on specific websites. She intercepts the publi
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!