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
What is the minimum amount of hard drive space required for a 64-bit Windows 10 installation?
BaLLatris [955]

The minimum requirements for a 64-bit Windows 10 installation are 2 GB of RAM and a minimum of 16 GB of space on the hard drive.

<em>Hope this helps :)</em>

7 0
2 years ago
OO<br>(A) 3 and 5<br>(B) 4 and 8<br>(C) 2 and 0<br>(D) 6 and 9<br>2. There are twelve books on a shelf and four children in a ro
dlinn [17]

Explanation:

2.there will be 8 books left on the shelf if each child takes one

8 0
3 years ago
From which panel can you insert Header and Footer in MS Word?​
Amanda [17]

Answer:

Insert tap is the answer

5 0
3 years ago
Read 2 more answers
How to bypass securly or fortiguard (fortinet)
ira [324]

Answer:

thanks for whatever you just said!! <3

Explanation:

3 0
3 years ago
You work part time at a computer repair store. You are in the process of building a new computer system. The customer wants a mo
kumpel [21]

Answer:

Building of a New Computer System

Explanation:

Specification

a motherboard having dual core 64 bit dual core processor with 8 GB RAM of dual channel memory support with 16x PCI Express slot for video card and firewire support.

8 0
4 years ago
Other questions:
  • Shakespeare’s complete works have approximately 3.5 million characters. Which is bigger in file size: Shakespeare’s complete wor
    5·2 answers
  • Constantine forms the following hypothesis. Let n be any non-negative number that meets the following condition: when n is divid
    10·1 answer
  • ________ is installed into special, read-only memory of devices like printers and print servers or devices used for various type
    13·1 answer
  • Which of the following is not an advanced strategy you may use to help you conduct a search on the Internet?
    12·1 answer
  • Give 4 examples of mnemonic codes, and what do they do?
    15·1 answer
  • Which of the following methodologies might be most appropriate if you have a system project with:unclear user requirements; unfa
    12·1 answer
  • What are the characteristics of Instant Search in Outlook 2016? Check all that apply. A)Typing whole phrases makes your search m
    12·1 answer
  • Pa sagot po TLE-10<br>need den po Ng solution thank you​
    14·1 answer
  • Do anyone know how to code like I need someone do a code for me?
    13·1 answer
  • What does it mean when someone says your voice doesn’t match how u look
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!