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
According to Mintzberg's classification of managerial roles, the role of a(n) ______ is to transmit information received from ou
enot [183]

Answer:

<h2>The answer is letter D</h2>

Explanation:

According to Mintzberg's classification, the disseminator is the informational sub-role in which the manager gives other employees or people outside the organization relevant information.

5 0
3 years ago
If a document is stored on a file server but team members can edit the document​ anonymously, the content on the file server is:
gogolik [260]

Answer:

d

Explanation:

Because a decimal number

3 0
3 years ago
TECHNICAL TERMS: the adderess of a website
riadik2000 [5.3K]
Yes very interesting
6 0
3 years ago
In many supermarkets customers can pay for their shopping using credit cards. (a) Name two items of information stored on the ma
slamgirl [31]

Answer:

Explanation:

Two items on the magnetic strip are, Credit Card info and Balance

Two ways supermarket may check are the PIN pad you are using to pay or their reciept system.

7 0
3 years ago
Is using abbreviations and symbols in social media a problem? Why or why not?
Ugo [173]
The correct answer is..A? 
5 0
3 years ago
Other questions:
  • major m,ajorrr points helpppppppppppppppppppppppppppi have a question i hit a few buttons and now my computer is saying everythi
    11·2 answers
  • Fullsoft, Inc. is a software development company based in New York City. Fullsoft’s software product development code is kept co
    10·1 answer
  • Match the software requirements of a server to their purpose
    5·1 answer
  • Which type of hypervisor does not run on an underlying operating system?
    13·1 answer
  • As the operations manager for a supermarket chain, Mai needs to find a telecommunications technology that: enables managers in r
    9·1 answer
  • which one of the following word process feature saves you the most time when you keying in a document
    9·1 answer
  • John works in the Sales and Marketing group. Why does his group need to interact with operations management to plan the launch o
    12·1 answer
  • State 4 basic operation performed by a computer​
    11·2 answers
  • Why should we apply print preview before printing the document.​
    11·1 answer
  • How does xm satellite deter nonsubscribers from listening to its transmissions? Does this make the radio programing a private go
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!