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
gulaghasi [49]
3 years ago
5

If you have a list consisting of just numbers, then you can add all of the values in the list using the sum() function. If your

list consists of some numbers and some values of other types (e.g., lists, strings, sets), the sum() function will fail. In this question, we're asking you to write a function that will sum all of the numbers in a list, ignoring the non-numbers. The function below takes one parameter: a list of values (value_list) of various types. The recommended approach for this: (1) create a variable to hold the current sum and initialize it to zero, (2) use a for loop to process each element of the list, (3) test each element to see if it is an integer or a float, and, if so, add its value to the current sum, (4) return the sum at the end.
Computers and Technology
1 answer:
Arte-miy333 [17]3 years ago
8 0

Answer:

def sum_numbers(value_list):

   total = 0

   for n in value_list:

       if type(n) == int or type(n) == float:

           total += n

   return total

Explanation:

Create a function called sum_numbers that takes one parameter, value_list

Initialize the total as 0

Create a for loop that iterates through the value_list

Inside the loop, check the type of the elements. If they are either int or float, add them to total.

When the loop is done, return the total

You might be interested in
Please help...........​
MrMuchimi

Answer:

Explanation:

As a user of GPL v3 software, you have lots of freedom: You can use GPL software for commercial purposes. You can modify the software and create derivative work. You can distribute the software and any derivative work you produce, without having to ask for permission or pay

4 0
2 years ago
Read 2 more answers
An experimenter discovers that the time for people to detect a string of letters on a computer screen is 400 milliseconds, and t
nadya68 [22]

Answer:

The correct answer to the following question will be Option D (Subtractive method ).

Explanation:

  • This approach essentially requests a participant to construct two activities that are already in almost every way similar, except for a mental process that is assumed to also be included in any of the activities although omitted in another.
  • This method will be much more valuable when deciding the period for phonemic awareness, despite text-string identification.

The other three options are not related to the given scenario. So that Option D is the right answer.

3 0
2 years ago
A _____ chart provides a simple way to show trends and variations in a range of data within a single cell
ludmilkaskok [199]
Most reasonable answer is a line chart.
 
With line charts you can spot trends and variations in a certain range of data through different times or just different values of the variable that we plot on the x-axis. In general, line charts are often used in research that wants to depict time trends or how a certain variable progresses through different levels of the variable on the x-axis.
8 0
3 years ago
A certain list, L, contains a total of n numbers, not necessarily distinct, that are arranged in increasing order. If L1 is the
Free_Kalibri [48]

In this question, we are given ,

  • A certain list, L, contains a total of n numbers, not necessarily distinct, that are arranged in increasing order.
  • L1 is the list consisting of the first n1 numbers in L.
  • L2 is the list consisting of the last n2 numbers in L.

Explanation:

As per the information given in statement 1, 17 is a mode for L1 and 17 is a mode for L2.

Therefore, we can infer that ,

  • 17 must occur in L1, either same or a greater number of times as any other number in L1.
  • 17 must occur in L1, either same or a greater number of times as any other number in L2.

As all elements in L are in ascending order, we can also conclude that

  • Each number between last occurrence of 17 in L1 and the first occurrence of 17 in L2 must be equal to 17 only.
  • Therefore, 17 occurs either same or greater number of times as any other number in L.
  • Thus, 17 is a mode for L.

However, from this statement, we cannot conclude anything about the mode of L1, L2, or L.

Hence, statement 2 is not sufficient to answer the question.

Therefore, 17 is a mode for L1 and 17 is a mode for L2.

3 0
2 years ago
the graph at left in the tctct, c-plane models the global wind power capacity, ccc, in gigawatts, ttt years since 199619961996.
Elena-2011 [213]

The intercept of a graph is the point where the graph crosses the axes of the graph.

The interpretation of the c-intercept is: <em>in 1996, the global wind power capacity was approximately 7 gigawatts.</em>

On the graph (see attachment), we have the following observations

  1. The vertical axis represents the global wind power capacity (i.e. the c-axis)
  2. The horizontal axis represents the years since 1996 (i.e. the t-axis)

So, the c-intercept is the point that crosses the vertical axis.

From the graph, the curve crosses the c-axis at c = 7, and t = 0 (i.e. years = 1996)

Hence, the interpretation of the c-intercept is: <em>in 1996, the global wind power capacity was approximately 7 gigawatts.</em>

<em />

<em />

Read more about intercepts at:

brainly.com/question/3334417

4 0
1 year ago
Other questions:
  • Your boss bought a new printer with a USB 3.0 port, and it came with a USB 3.0 cable. Your boss asks you: Will the printer work
    14·1 answer
  • Given three floating-point numbers x, y, and z, output x to the power of y, x to the power of (y to the power of z), the absolut
    9·1 answer
  • Which player type focuses on level progression?
    13·1 answer
  • What happens if i receive a text while my phone is off?
    15·1 answer
  • What feature of a word processing program helps you to easily check and correct spelling mistakes?
    9·1 answer
  • True/False
    13·1 answer
  • 3.5 Code Practice: Question 1<br> (Website: Edhesive)
    14·1 answer
  • How can I download music and films at home without breaking the law?
    11·2 answers
  • David plays racing games on his way to work. He uses the analog stick to navigate his vehicle through other artificial intellige
    7·2 answers
  • I need help NOW with my java script!! 1. What will the code below output to the console and why? const person = {
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!