![subject](/tpl/images/cats/informatica.png)
Computers and Technology, 06.05.2020 00:28 timozy95
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.
student. py 1
Hef sum_lengths(value_list):
# Implement your function here. Be sure to indent your code block! Restore original file
![ansver](/tpl/images/cats/User.png)
Answers: 3
![](/tpl/images/ask_question.png)
![](/tpl/images/ask_question_mob.png)
Another question on Computers and Technology
![question](/tpl/images/cats/informatica.png)
Computers and Technology, 23.06.2019 02:30
What is the power dissipated by a resistor with a current of 0.02 a and a resistance of 1,000 ? a. 200 w b. 20 w c. 0.4 w d. 4 w
Answers: 1
![question](/tpl/images/cats/informatica.png)
Computers and Technology, 24.06.2019 07:00
You are most likely to automatically encode information about
Answers: 1
![question](/tpl/images/cats/informatica.png)
Computers and Technology, 24.06.2019 11:00
These statements describe lists in presentation programs: a. bullets can be turned off and on. b. bullets cannot be turned off. c. bullet styles, colors, and sizes can be changed. d. lists don't have to use bullets or numbers. e. numbering styles, colors, and sizes can be changed. f. numbers can be turned off and on. g. numbers cannot be turned off. select all that apply
Answers: 2
![question](/tpl/images/cats/informatica.png)
Computers and Technology, 24.06.2019 20:00
Which element will you include to present numerical on a slide? a: graph b: text c: flowchart d: shapes
Answers: 1
You know the right answer?
If you have a list consisting of just numbers, then you can add all of the values in the list using...
Questions
![question](/tpl/images/cats/en.png)
![question](/tpl/images/cats/en.png)
![question](/tpl/images/cats/en.png)
![question](/tpl/images/cats/biologiya.png)
Biology, 17.03.2021 23:40
![question](/tpl/images/cats/himiya.png)
![question](/tpl/images/cats/en.png)
English, 17.03.2021 23:40
![question](/tpl/images/cats/es.png)
Spanish, 17.03.2021 23:40
![question](/tpl/images/cats/health.png)
![question](/tpl/images/cats/health.png)
![question](/tpl/images/cats/mat.png)
Mathematics, 17.03.2021 23:40
![question](/tpl/images/cats/istoriya.png)
History, 17.03.2021 23:40
![question](/tpl/images/cats/mat.png)
Mathematics, 17.03.2021 23:40
![question](/tpl/images/cats/biologiya.png)
![question](/tpl/images/cats/mat.png)
![question](/tpl/images/cats/mat.png)
![question](/tpl/images/cats/mat.png)
Mathematics, 17.03.2021 23:40
![question](/tpl/images/cats/fizika.png)
![question](/tpl/images/cats/en.png)
English, 17.03.2021 23:40
![question](/tpl/images/cats/istoriya.png)
History, 17.03.2021 23:40
![question](/tpl/images/cats/mat.png)
Mathematics, 17.03.2021 23:40