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
il63 [147K]
3 years ago
10

Given a variable temps that refers to a list, all of whose elements refer to values of type float, representing temperature data

, compute the average temperature and assign it to a variable named avg_temp. Besides temps and avg_temp, you may use two other variables -- k and total.temps = []
avg_temp = 0.0
total = 0.0

for k in range(temps):
total += k

avg_temp = total/len(temps)

Computers and Technology
2 answers:
Anna35 [415]3 years ago
7 0

Answer:

temps = [10.2, 20.4, 30.0]

avg_temp = 0.0

total = 0.0

for k in temps:

   total += k

avg_temp = total/len(temps)

print(avg_temp)

Explanation:

- Create a list temps, that holds value for temperatures

- Initialize the average and total

- Initialize a for loop that iterates through the temps

- Add the values in temp to the total

- When the loop is done, calculate the average

- Print the average

suter [353]3 years ago
5 0

Answer:

temps = [23.4, 20.2, 19.5, 21.3, 18.7, 25.4, 24.9]

avg_temp = 0.0

total = 0.0

for k in temps:

 total += k

print("The total is \n", total)  

avg_temp = total/len(temps)

print("The average temperature is \n", avg_temp)

Explanation:

Using Python programming language

Create a list with seven values for daily temperature values (Its hard-coded to represent seven days of the week)

Declare and initialize to zero the variables avg_temp and total

Use a for loop to add elements of the list

Print the values

see attached code and output

You might be interested in
Analyze the following code: class Test { public static void main(String[] args) { System.out.println(xMethod((double)5)); } publ
SashulF [63]

Answer:

This code will give Error.

Explanation:

This code will give error because we have passed the argument 5 as double by using typecasting.We have two methods named xMethod but with arguments as int and long none of them has argument as double.The compiler will not be able to find the method with double argument.So this code will not run because of this reason.

3 0
2 years ago
What is an "immediate preemptive scheduler"?
lyudmila [28]
In computing<span>, </span>preemption<span> is the act of temporarily interrupting a </span>task<span> being carried out by a </span>computer system<span>, without requiring its cooperation, and with the intention of resuming the task at a later time.</span>
6 0
3 years ago
Please help i really need to turn this in already
Step2247 [10]

V = √P*R

RED

It doesn't really do anything active wise but it is used to reduce current flows, adjust signal levels, and to divide voltage.

7 0
3 years ago
The purpose of multivariate analysis in index construction is to discover the simultaneous interaction of the items to determine
pychu [463]

Answer:

The answer is TRUE. It is a TRUE statement.

Explanation:

Multivariate analysis is the analysis of simultaneous interactions between several variables. If two items are very correlated, they could all be included in the same index.

7 0
2 years ago
What does an "embedded video" mean
ipn [44]
It’s when you are hosting the video at another location and simply linking to it
5 0
2 years ago
Other questions:
  • In doing a load of clothes, a clothes drier uses 18 A of current at 240 V for 59 min. A personal computer, in contrast, uses 3.0
    7·1 answer
  • The first step in the five-step process for problem solving is to ____. evaluate take action understand the task or need complet
    10·2 answers
  • Which is an example of a screenshot?
    7·2 answers
  • Assume you have a project with seven activities labeled A-G (following). Derive the earliest completion time (or early finish-EF
    15·1 answer
  • True or False: When you share something on a friend’s Timeline, only that friend can see it.
    5·2 answers
  • Whats a field in databases?
    5·1 answer
  • Tradegy deals with _____
    14·1 answer
  • Please describe the role of games in modern society!
    5·2 answers
  • Which computer peripheral is used when you would like to use a DVD or CD?
    12·2 answers
  • You are the IT administrator for a small corporate network. The employee in Office 2 is setting up a virtualization environment
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!