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
serious [3.7K]
3 years ago
11

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

a, compute the average temperature and assign it to a variable named avg_temp . Besides temps and avg_temp , you may use two othervariables -- k and total .
My solution below didn't work. I wonder how to go about this problem.

temps = []

avg_temp = 0.0
total = 0.0

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

avg_temp = total/len(temps)
Computers and Technology
1 answer:
VARVARA [1.3K]3 years ago
5 0

Answer:

The problem of the question code is as follows:

Explanation:

  1. There must be the items in the list: The above question code is in python language. The temps are a list type variable that is used to hold the collection of items or value. But in the above code, there is no item in the K list. So first remove this problem with the help of add the value on the list. There are two ways to add value to the list:- 1. Define the static list element by writing like "temps=[1.2,2.4,4.5]". and 2. Take input from the user and then add by "temps.append(item)".
  2. The syntax of the for loop: The syntax of the for loop is not right because it holds the "range" keyword which is written when we give the numeric value like, "for x in range(2)" or "for x in range(1,2)". So to correct for syntax the user needs to write "for k in temps:".

If the user removes the above-defined error from the code then the above code will run correctly

You might be interested in
Which of the following occupations uses math concepts to determine if a particular event would occur and the related costs of th
krek1111 [17]

The occupations that utilize math concepts to determine if a particular event would occur and the related costs of the occurrence is Actuary statistician.

This statistician helps in related costs of the occurrence as well as other datas.

<h3>Who is actuary statistician?</h3>

Actuaries are experts that works in insurance industry that wirk on data related to risk as well as statistical probabilities of future occurrences.

Learn more about statistians at;

brainly.com/question/15980493

4 0
3 years ago
The Android operating system was invented by ______.
EleoNora [17]

The Android operating system was invented by <u>google</u> in 2005.

4 0
3 years ago
Which term accurately describes agile and devops
Elza [17]

Answer:

Answer: Agile is refers to an interative approuch which focuses on collaboration, costumer feedback,and small rapid releases,DevOps is considered a practice bringing development and operations teams together

Hope this is helpful for you

7 0
3 years ago
Bill's manager has asked him to send all staff members the directions for checking out the new projector. In one to two sentence
lawyer [7]
He could probably send an email to everyone.
or if they are at work he could conduct a conference.Or can paste the instructions on a public tasks board.

Hope it helps you.

:)
3 0
3 years ago
Read 2 more answers
30 POINTS !!!!!!!!
alex41 [277]

this should help! i read over the article a little bit and it seems to answer your question pretty well. https://www.snap.com.au/articles/the-pros-and-cons-of-digital-and-offset-printing.html

7 0
3 years ago
Other questions:
  • Materials such as copper, silver, and aluminum through which electric energy passes freely are called
    13·1 answer
  • When using a file name you have to use only lower case letters<br>true or false
    11·1 answer
  • It is advised to always have discretion with leaders. Explain in general terms what information security policies can and cannot
    12·1 answer
  • Write a function named "list_concat" that takes a list of strings as a parameter and returns the concatenation of all the values
    13·1 answer
  • Which three factors should be discussed before planning and building a project?
    15·1 answer
  • To specify AutoCorrect rules and exceptions to the rules, click File to open the Backstage view, click ____ , and then click Pro
    6·1 answer
  • Match the component to its function. resistor inductor capacitor battery transistor This component stores a temporary charge. ar
    7·2 answers
  • An organization has hired a new remote workforce. Many new employees are reporting that they are unable to access the shared net
    11·1 answer
  • Who invented slide Rule and when?​
    7·2 answers
  • True or False: VLANs in cloud computing are most likely to be found on direct connections with a CSP.
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!