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
___________ is a mass-produced, copyrighted software that meets the needs of a wide variety of users, not just a single user or
GaryK [48]

Answer: Package software

Explanation:

Packaged software is the software that contains the functions and programs that are similar in the nature and features.

It is designed in such a way so that it can attract the customers and user by providing the benefit of the selling of the collection of programs rather than buying individual software programs which costs higher.

Thus, it produced at a large scale as well as bought by numerous users.

4 0
4 years ago
Python is an example of a low level programming language true or false?​
alekssr [168]
False- python is an example of a high level language. Other high levels are c++, PHP, and Java
6 0
3 years ago
Assume you're using a three button mouse. To connect shortcut menus, you would what
Grace [21]
You would click the right button to a shortcuts

5 0
3 years ago
Which term refers to the technical structure of the software, how users interact with the software, and how the software is phys
mars1129 [50]
The Answer is <span> Architecture</span>
7 0
3 years ago
Is apple better than android
KatRina [158]

In a sense yes as it has a more user friendly interface but in terms of usability android is a far better os

3 0
4 years ago
Read 2 more answers
Other questions:
  • A(n) _______ allows an attacker to use a network structure to send large volumes of packets to a victim.
    5·1 answer
  • What are the Database used in RDBMS and DBMS<br>please answer immediately​
    10·1 answer
  • What impact did congress declaration on copyrighting sound recordings have on home recording and record sales
    8·2 answers
  • HELP ASAP!!!
    7·1 answer
  • What keyboard functions lets you delete words
    15·2 answers
  • What is computer topology​
    5·2 answers
  • What are some positive impacts technology has on the environment?​
    5·2 answers
  • What is the initial condition in this set of code?
    8·1 answer
  • A CPU has just been powered on and it immediately executes a machine code instruction. What is the most likely type of instructi
    13·1 answer
  • 6. Write a C++ program to print the largest three elements in an array. <br>​
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!