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]
4 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]4 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]4 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
When assigning a value to a string, which of the following rules needs to be followed?
Alecsey [184]

Answer:

Let's say you need to remember some information, the way moviegoers tried to remember the name of the movie. Instead of storing it in your human memory, you can store information in your computer's memory using Python. This is called assigning a string value to a variable.

To assign a string value to a variable in Python, follow this example. Select each part of the code to see how it works with the movie title example.

movieTitle = "Live. Die. Repeat."

This line of Python code is an example of an assignment statement. In an assignment statement, you tell Python, "This variable is assigned this string value."

Explanation:

4 0
3 years ago
When Cloud Consumers are automatically redirected to the new cloud storage device?
Taya2010 [7]

Answer:

Cloud architecture are basically depend upon the storage replication system and it keeps synchronize the primary cloud data in the duplication storage.

And the redundant data is used when the logical unit number are migrated from one place to another. Then, it creates a copy of logical unit number.

Whenever, the primary device fail the storage path diverts the request of cloud user in secondary logical unit number and it automatically redirect to new cloud device storage.

6 0
4 years ago
True or False <br><br> MAC addresses are assigned by the router along with your IP address.
Oduvanchick [21]
True. If you look at the router it will correspond with your MAC address
4 0
3 years ago
Sends a copy of the message and any additional comments to a different e-mail address
Debora [2.8K]

Answer:

Forward.

Explanation:

E-mail is an acronym for electronic mail and it can be defined as a set of written words, texts, characters used for conveying a message from one person to another. It is a channel or medium of communication between one person and the other.

Forward simply sends a copy of the message and any additional comments to a different e-mail address. The term forward is used in email to describe the process of sending a message.

3 0
4 years ago
Which of the following are recommended ways to address run-time errors? Choose all that apply.
Fittoniya [83]

Answer:

2. Add error routines that allow the program to execute fully even when unanticipated data is entered.

3. Create error messages to alert the user to an error in data entry.

4. Create controls in the program that ensure the input of proper data.

Explanation:

Mark me brainliest plz

6 0
3 years ago
Read 2 more answers
Other questions:
  • Who will win the premier league
    9·2 answers
  • What is the purpose of the .NET Framework Class Library? a. it provides pre-written code that can be used by .NET applications b
    13·1 answer
  • Write a function that implements another stack function, peek. Peek returns the value of the first element on the stack without
    11·1 answer
  • To maintain her audience's confidence in her, what should kiara not do while delivering her presentation?
    6·2 answers
  • What does a mother board in a computer do?
    11·1 answer
  • If a web address is written as http://www.mywebprescence.com/index.html: What part of this address is considered to be the webpa
    8·1 answer
  • What is the correct order of the phases of the software development process?
    12·1 answer
  • Kareem is working on a project for his manager. He has a few questions for a co-worker who he knows is knowledgeable on the subj
    7·1 answer
  • Write a definition in your own words for GUI. Do not copy and paste please.
    8·2 answers
  • A(n) _____ is an organization's management support system that combines many databases to improve management decision making.
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!