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
Some files appear dimmed in one of the default folders on your computer. What would be the best course of action?
Wittaler [7]
It appears that they might be labeled "Hidden" in the properties of that file. Right Click on Properties and Uncheckmark Hidden<span />
7 0
3 years ago
Can someone please tell me what I’m doing wrong ? Please and it’s due on Thursday!!
liberstina [14]

Answer:

Sure. In Unit test 5, it's looking for 1 instead of 0. You are returning 0 instead of 1.

0 requires 1 digit to express it and should therefore return 1.

In line 6, change the 0 to a 1.

8 0
2 years ago
How many owners does a sole proprietorship have?
never [62]
The sole proprietorship it is the simplist business form under which one can operate a business. the answer is one.
8 0
3 years ago
Help me pleaseeee!
kenny6666 [7]

Answer:

Try checking around on the router!

Explanation:

Assuming they haven't changed it, most routers have their default password displayed somewhere on it. I hope this helps!! ^^

5 0
2 years ago
Read 2 more answers
Which types of charts are examples found in Excel? Check all that apply.
marysya [2.9K]

Answer: 1,2,4,5,6

Explanation:

columns

bar

histogram

pie

scatterplot

5 0
3 years ago
Other questions:
  • What does OLE stand for? Object
    8·2 answers
  • Which represents the hierarchical structure of a Google Analytics account from top to bottom?
    5·1 answer
  • One form of e-mail attack that is also a DoS attack is called a mail spoof, in which an attacker overwhelms the receiver with ex
    14·1 answer
  • Here is the problem specification: An Internet service provider has three different subscription packages for its customers: Pac
    5·1 answer
  • When hacking a website to test a secure connection and ensure internet safety, what is a good way to check the coding of the web
    14·1 answer
  • Fern has set up a computer network for the entire building. Unfortunately, the signal strength diminishes as it reaches toward t
    8·1 answer
  • Plz answer the following ​
    9·2 answers
  • Zara wants to create some lines of code that are ignored by the computer. What should these lines begin with?
    5·1 answer
  • The first version of Windows to have automatic updates from the Internet was _____.
    13·1 answer
  • Input a list of employee names and salaries and store them in parallel arrays. End the input with a sentinel value. The salaries
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!