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
Setler79 [48]
3 years ago
12

Define a function below, sum_numeric_vals, which takes a single dictionary as a parameter. The dictionary has only strings for k

eys, but can have string or integer values. Complete the function to calculate and return the sum of the integer values in the dictionary.
Computers and Technology
1 answer:
notka56 [123]3 years ago
3 0

Answer:

Following are the program in the Python Programming language.

#define function

def sum_numeric_vals(dic):

 #set and initialize the integer variable to 0

 sum_total = 0

 #set the for loop to extract the value of dictionary

 for val in dic.values():

   #set if condition to find the sum

   if type(val)==int:

     sum_total += val

 #return the sum of the values

 return sum_total

#set and initialize dictionary type variable

dic={"Two":2,"Four":4}

#call and print the function

print(sum_numeric_vals(dic))

<u>Output:</u>

6

Explanation:

Here, we define the function "sum_numeric_vals()" and pass an argument "dic", inside the function.

  • Set and initialize an integer data type variable "sum_total" to 0.
  • Set the for loop which extract the values of the dictionary.
  • Set the if conditional statement inside the loop to find the sum of the values of the dictionary.
  • Then, return the sum of the values of the dictionary.

Finally, we set and initialize the dictionary type variable "dic" and pass it in the function's argument list then, call the function through the print function

You might be interested in
One random part of Chess is whether the white side or the black side moves first? A. True B. False
ohaa [14]
The correct answer is B. false.
Determining which color goes first is not random at all - it is a rule in chess that the White player will always start the game first, and will then be followed by the Black player. 
5 0
3 years ago
Read 2 more answers
A media file refers to what kind of file? A. Clip art
prohojiy [21]

Waveform Audio (.wav) is a common file format. Created by Microsoft and IBM, WAV was one of the first audio file types developed for the PC. WAV files are defined as lossless, meaning that files are large and complete; nothing has been lost.

your answer will be

<h2><em><u>C; image</u></em></h2>
5 0
3 years ago
Read 2 more answers
The following SQL statement contains which type of subquery? SELECT title FROM books WHERE EXISTS (SELECT isbn FROM orderitems W
Rudiy27

Answer:

(a) Correlated.

Explanation:

Correlated subquery :These sub queries reference columns from outer table or uses values from outer query.These sub queries are processed atleast once for every row processed.So because of this reason correlated sub queries can be slow.Since the query in the question also uses value from the outer query so it is a correlated query.

4 0
3 years ago
Which option should you select to ignore all tracked changes in a document? To ignore all tracked changes in a document, you sho
Cloud [144]

Answer:

where is the options

Explanation:

4 0
2 years ago
After class, Anita and Bev make plans to study for their psychology exam together but cannot decide on a time or location. In ad
Paladinen [302]

Answer:

Option B; 30 SECONDS OR LESS.

Explanation:

Short-term memory, also known as primary or active memory, is the information we are currently aware of or thinking about.

When short-term memories are not rehearsed or actively maintained, they last mere seconds.

Most of the information kept in short-term memory will be stored for less than 30 seconds (approximately 20 to 30 seconds), but it can be just seconds if rehearsal or active maintenance of the information is not done.

Therefore, Anita likely will be able to retain the information in short-term memory, without additional processing, for 30 SECONDS OR LESS.

8 0
3 years ago
Other questions:
  • A Web ____ is a software program that retrieves the page and displays it. Select one:
    5·1 answer
  • Employers will check you out on social media sites like Facebook, MySpace, and Twitter.
    6·2 answers
  • Provide examples of the cost of quality based on your own experiences
    14·1 answer
  • What do libraries allow you to do in C++, and how do you incorporate libraries into a C++ program?
    10·1 answer
  • FlimFlam.Shop is the best clothing shop ever.
    9·2 answers
  • What legal protection would cover a person invention?
    10·2 answers
  • State five differences between Dos and Windows.​
    14·1 answer
  • Nora has shared a document with others, and she needs to be able to easily identify when others are modifying the
    5·1 answer
  • Write a Coral program using integers userNum and x as input, and output userNum divided by x four times.
    7·1 answer
  • What are the components of computer system??<br>​
    10·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!