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
Letter only ^_____^!
vagabundo [1.1K]

b serves as food for the yeast

4 0
3 years ago
Write and test a Python program to find and print the largest number in a set of real (floating point) numbers. The program shou
fenix001 [56]

I can't read oooooyeaaaa

3 0
3 years ago
Whats the best app for cheaters​
Sladkaya [172]

The for cheaters? Like what kind of Cheaters?

Explanation:

6 0
3 years ago
Suzy lives alone in New York, whereas her family lives in Florida. It is difficult for Suzy to visit her family very frequently,
Luda [366]
Answer:

<span>Skype.

---> Skype can most probably help Suzy given that the application allows for people to message, talk and video chat. This means that Suzy can see her family through video call, and see their face.

Best of wishes! xx :)</span>
4 0
3 years ago
Read 2 more answers
Why is the len ( ) function useful when using a loop to iterate through a stack?
Marizza181 [45]

The len ( ) function will run with each iteration, printing the element number each time.

6 0
3 years ago
Other questions:
  • As it relates to confidentiality, data may be classified in three ways. Match each data classification below to its definition.
    9·1 answer
  • Your motherboard supports dual channeling and you currently have two slots used in channel a on the board; each module holds 1 g
    15·1 answer
  • which one of these steps describe saving a newly created file. click on the save icon. minimize the file. name the file. select
    12·2 answers
  • Write a program segment with a do-while loop that displays whether a user-entered integer is even or odd. The code should then a
    5·1 answer
  • Write an expression using membership operators that prints "Special number" if special_num is one of the special numbers stored
    12·1 answer
  • What feature sets Macs apart from other operating systems?
    5·1 answer
  • ¿ El Parque Fray y Jorge es un patrimonio Cultural/Natural o patrimonial de Chile ?
    14·1 answer
  • What are two potential benefits of using calendar-synchronization tools like calendly
    8·1 answer
  • Which of the following is an example of two-factor authentication?
    10·2 answers
  • What is a simple definition for electricity?
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!