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
Word documents contain how many sections by default?
Butoxors [25]

Answer:

Word documents contain one section by default

Explanation:

8 0
3 years ago
What is the square root of 1600 and 36 ?​
liraira [26]

Answer:

1600 - 40

36 - 6

Explanation:

3 0
3 years ago
What is the difference between player-centric game design and designer-centric game design? How does a player-centric game assis
RoseWind [281]

<u>Answer</u>:

<em>A player centric game would be one of the best game where the player would navigate till the end of the game. </em>

<u>Explanation</u>:

It is the game, where the designer considered himself as <em>a player and make the background picture, music, character, challenge </em>everything would be tackled in a fun-filled way.

A <em>designer centric game would be a one, where the player wouldn’t enjoy playing and will never be able to complete the entire game</em> and would have been tired of listening to the background music and other <em>unfriendly aspects in the game.</em>

8 0
4 years ago
Help brainleist giving exam
Digiron [165]

Explanation:

11. True

12: Electronic Fund Transfer

13. True

14. I'm not sure but I think yes?..

(I'm not sure if your including number 15 but just in case, the full form of PIN is personal identification number)

4 0
3 years ago
How is an interpreter different from a compiler?
lyudmila [28]

Answer:

An interpreter is quite different from a complier due to the following statement below:

O. An interpreter translates and executes code line by line, while a compiler translates all code at once so that it is ready to be executed at any time.

Explanation:

For an interpreter, it works in translating and execution of the codes line after another line. In a situation where there is a mistake in the code, the next line would not be able to be executed, but rather display error message. On the other hand, compiler translate all codes at once and execute them as a single work.

<em>During its translation of the codes in compiler, should there be any error, it would not be able to execute despite the fact that, the error might be in the last line of the code.</em>

7 0
3 years ago
Read 2 more answers
Other questions:
  • The two variables causing the point of difference between the time codes are the frequency and the count
    6·1 answer
  • Why should you not perform any personal grooming task while driving?
    5·2 answers
  • Follow up, my brother is upset at me for stealing his robux, what should i do?
    11·2 answers
  • Write a function to output an array of ints on a single line. Funtion Should take an array and an array length and return a void
    9·1 answer
  • What does Putting a word in quotation marks on your search bar do on google?
    12·1 answer
  • What is application software? A computer language for accessing data in a database. A character string used to identify the loca
    10·1 answer
  • According to which virtue do you need to secure information by limiting computer access to authorized personnel only?
    6·1 answer
  • In one to two sentences, describe how you would add a new slide to your presentation.
    11·2 answers
  • Which of the following describe audio-editing software? Choose all that apply.
    5·2 answers
  • You want to add a caption to a table. which tab contains this option?.
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!