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
The ability to use various design software such as Adobe Photoshop, InDesign, and Illustrator would be MOST beneficial to which
NikAS [45]
Answer: b
Explanation:
5 0
3 years ago
When using color in computer-generated presentation aids, you should use?
REY [17]
When using color in computer-generated presentation, you should use the same background color on all visuals and no more than two colors for words. This is a p<span>rinciples of </span>color and must be applied in computer-generated presentation aids like models,g<span>raphics( visual representations of information) and pictures (photographs and illustrations).</span>
7 0
3 years ago
Which function in Excel tells how many
Vikki [24]

Answer:

COUNT

Explanation:

Hope this helps! Plz mark brainliest!

3 0
3 years ago
_____ consists of the instructions that direct the operation of the computer system and enable users to perform specific tasks,
kaheart [24]

Answer:

Software

Explanation:

6 0
3 years ago
February 1995, Kevin Mitnick was arrested. While on parole was he allowed to have a phone or computer?
m_a_m_a [10]

Answer:

He was not allowed on a phone of computer after being arrested.

Explanation:

If you read about it he wasn't even allowed to work at 7-11 because of an electronic cash register.

6 0
3 years ago
Read 2 more answers
Other questions:
  • When a cache block has been modified since being read from main memory?
    10·2 answers
  • Information permanently stored on a hard disk, diskette, cd-rom disk, or tape, is called ________ storage.
    8·1 answer
  • A. true
    6·1 answer
  • The contents of an array of type ______ can be displayed with the cout operator (without specifying an element). - 1 point(s)
    14·1 answer
  • If we have a priority queue storing approximately million numbers, and the bottom level is "full", which of the following statem
    9·1 answer
  • Write a program that converst the temperature from Celcius to Fahrenheit. The formula is: F (9/5)C+32
    12·2 answers
  • How do media and networks interact? A. Networks and media work in exactly the same way. B. Media are connected to networks that
    8·1 answer
  • Excel files have a default extension of ?
    12·1 answer
  • 5.7 AP-Style MC Practice edhessive
    14·1 answer
  • Laptop computers use PCMCIA cards, another type of ________
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!