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]
3 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]3 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
The refresh or reload button is in the browser toolbar and usually looks like a pair of curved arrows. Clicking it will ________
docker41 [41]

Your answer would be

D. Restart the downloading process

5 0
3 years ago
Read 2 more answers
One way bloggers decide how to present information is by understanding
PSYCHO15rus [73]

I would say strong use of multimedia.

4 0
3 years ago
Read 2 more answers
The man-in-the-middle attack<br> means what
Tom [10]

Answer:

<em> where the attacker secretly relays and possibly alters the communications between two parties who believe that they are directly communicating with each other.</em>

Explanation:

4 0
3 years ago
4 brainly
Allushta [10]
Web designers like create websites for businesses
6 0
2 years ago
From an SEO perspective, why is it important to have text alternatives to media items like images, audio, and video?
Ann [662]

Explanation:

This is because the SEO might not be able to access the media items wherever they are, or they could be deleted, or the media items may not be compatible with the SEO. It could also help to have alternatives for accessibility purposes. Therefore, it is important for the SEO to have alternatives to display incase a media item is unable to display for whatever reason.

8 0
2 years ago
Read 2 more answers
Other questions:
  • All objects in an object-oriented program are instantiated (created) from a ____.
    12·1 answer
  • If you feel that an OSHA inspection is needed to get hazards corrected at your workplace, which is your best option?
    7·1 answer
  • In creating a professional action plan it's important to
    12·1 answer
  • You have four DCs in your domain. Active Directory appears to be corrupted on one of the DCs, and you suspect a failing hard dri
    5·1 answer
  • Using a "word" of 5 bits, list all of the possible signed binary numbers and their decimal equivalents that are represent able i
    12·1 answer
  • Explain one way in which programmers may get hired.
    9·1 answer
  • Write a Java program to create a class called Cars. The class should include three instance variables: makes (type: String), mod
    12·1 answer
  • 1.Discuss why this class is important (or not) to a soon-to-be security practitioner. 2.Discuss one of more subjects you have le
    7·1 answer
  • What are 6 subtopics on computer programming ?
    13·1 answer
  • What are the different types of monitors?
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!