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
Where do you go to create a workbook?​
Over [174]

Answer:

The explaination of this question is given below in the explanation section

Explanation:

The following steps are used to create a workbook.

1- Go to start menu and search about EXCEL (application software) and then click on it to open.

If you already opened a EXCEL's workbook, and you want to create a new workbook, then you follow the following steps:

  1. Click the File tab.
  2. Click New.
  3. Under Available Templates, double-click Blank Workbook. Keyboard shortcut To quickly create a new, blank workbook, you can also press CTRL+N.

A new workbook will be created.

6 0
3 years ago
Where is the BIOS chip located?
masya89 [10]

Answer:

on the motherboard inside the computer

6 0
3 years ago
Read 2 more answers
Possible consequences for plagiarism, listed in CAVA's Academic Integrity Policy, may include:
Ahat [919]

CAVA’s Academic Integrity Policy refers to Calfornia Virtual Academic’s policy book for students of their schools, which are public charter schools in the state of California.

In the handbook, it is mentioned that students who commit plagiarism will be required to re-submit the assignment during the first offence; will receive a fail grade for the assignment during the second offence; and will be withdrawn from a course or even the school during the third offence.

Thus the answer to the question is (D) all of the above.

8 0
3 years ago
A mother age is formed by reversing the two digits of daughters age. If the mother is 18 years older than daughter and sum of th
Gwar [14]
I'm not absolutely positive that my answer is correct... but here's what I got...

Mother: 33 years old

Daughter: 15 years old
4 0
3 years ago
Which of these is an advantage of having multiple layers in a drawing and enables you to make changes to one part of an image wi
Ivan

Answer:

enables you to make changes to one part of an image without accidentally changing other parts

Explanation:

Computer aided designs incorporate the use of multiple layers in drawings. The first layer is known as the layer 0, while the present layer the designer is working on is known as the current layer. The advantage of the incorporation of layers in designs include the following

1. It helps objects to be altered, grouped, hidden and moved as the designer wishes.

2. Layers can be grouped and worked on separated and common properties like color and line weight assigned to them.

3. Layers can be manipulated as the user wishes. They can be locked, frozen, turned off, etc.  Locking prevents accidental changes being made on objects.

4 0
2 years ago
Other questions:
  • Changing the position of the wing will
    9·1 answer
  • The ________ method displays a message to the user and contains one button.
    6·1 answer
  • Traffic collisions are among the top killers of children in America.
    13·1 answer
  • ________________is a distribution of Linux Operating<br>system for desktop computers.<br>​
    15·1 answer
  • Study the images of two different fronts.
    7·2 answers
  • NAT is able to stop ________. Group of answer choices a) scanning probes sniffers from learning anything about the internal IP a
    8·2 answers
  • Which job role requires you to create user guides for computer products and services?
    11·1 answer
  • What symbol indicates that material has been copyrighted?
    8·2 answers
  • Discuss how a lack of infrastructure in poor communities could contribute to ill-health such as the Unrest looting.​
    9·1 answer
  • What are five types of applications you can create in Visual Basic 2017?
    12·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!