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
Angela recently purchased a new Android smartphone. While purchasing the phone, Angela was told that she would need to set up a
vagabundo [1.1K]

Answer:

G m a i l

Explanation:

G m a i l by Google is the main commercial email provider to Android Phones. This is because it offers so many features that other email provider do not. One of this is the ability to backup your data, including contacts, messages, and others. This features along with other features makes Google g m a i l account the best option for Android users.

8 0
3 years ago
Which of the following technologies is the best choice to convey urgent and highly sensitive information?a. Telephone b. Fax Let
Setler79 [48]

Answer:

C. E-mail

Explanation:

Electronic mail is the best choice to convey urgent and highly sensitive information

8 0
3 years ago
Which line in the following program contains the header for the showDub function? 1 #include 2 using namespace std; 3 4 void sho
Flura [38]

Answer:

The answer to this question is "15 line".

Explanation:

A function is a block of ordered, portable code used to perform a single, connected operation. The syntax of function declaration can be given as:

Syntax :

returntype functionName(parameter1, parameter2); //function prototype

or declaration

returntype functionName(parameter1, parameter2) //function definition or header of the function  

{  

//function body.

//function implementation

 //return value;

}

In the given question the header of the showDub function is on line 15.

That's why the answer to this question is "15 line".  

8 0
3 years ago
Who was responsible for the development of the rocket motor?
kiruha [24]

Answer: Robert H. Goddard

Explanation: he developed and flew the first liquid-propellant rocket

6 0
3 years ago
Read 2 more answers
An object reference provides a(an)______for an object and is used to gain access to the object (Points : 2) entry
sdas [7]

Answer: Instance

Explanation: Instance is the term found in the object-orient programming concept. It is used for the realization of the variation present in any object specifically.The program execution at each time instant is known as the instance of program. Generation of realized instance is known as instantiation.

This helps in the accessing of the object in the program.Other options are incorrect entry , target and handle are not the technical term related with the accessing of object .Thus the correct answer is instance.

3 0
3 years ago
Other questions:
  • Categorize the following relationships into generalization, aggregation, or association. Beware, there may be n-ary associations
    14·1 answer
  • What type of document would you use the landscape page orientation
    7·1 answer
  • Which devices are managed through device management?
    15·2 answers
  • An interpreter _______. converts the procedural language one statement at a time converts the source code into machine language
    12·1 answer
  • Whats the best app for cheaters​
    9·1 answer
  • To implement the various placement algorithms discussed for dynamic partitioning (see Section 7.2 ), a list of the free blocks o
    11·1 answer
  • Testing for information would be most likely to occur in which type of engineering?
    5·2 answers
  • Use the drop-down tool to select the word or phrase that completes each sentence.
    7·1 answer
  • Choose the appropriate computing generation.
    7·2 answers
  • You are testing the user experience.
    12·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!