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
Andreas93 [3]
3 years ago
8

Define a function named sum_values with two parameters. The first parameter will be a list of dictionaries (the data). The secon

d parameter will be a string (a key). Return the sum of the dictionaries' values associated with the second parameter. You SHOULD NOT assume that all of the dictionaries in the first parameter will have the second parameter as a key. If none of the dictionaries have the second parameter as a key, your function should return 0. Sample function call: sum_values(data, 'estimated_annual_kwh_savings') sum_values_by_year
Computers and Technology
1 answer:
Marina86 [1]3 years ago
6 0

Answer:

Answered below

Explanation:

//Program is written in Python

sum = 0

def sum_of_values(dict_data, number_of_boys):

for dict in dict_data:

for key in dict.keys():

if key == number_of_boys:

sum += dict[key]

//After looping check the sum variable and //return the appropriate value.

if sum != 0:

return sum

elif sum == 0:

//There was no key of such so no addition.

return 0

You might be interested in
A peripheral can be used to tell a computer to complete a specific task.<br> A) True <br> B)False
RoseWind [281]

Answer:

A. true

Explanation:

<em><u>because</u></em><em><u> </u></em><em><u>you</u></em><em><u> </u></em><em><u>can</u></em><em><u> </u></em><em><u>complete</u></em><em><u> </u></em><em><u>it</u></em><em><u> </u></em><em><u>without it</u></em><em><u> </u></em><em><u>mistakes</u></em><em><u> </u></em><em><u>if</u></em><em><u> </u></em><em><u>your</u></em><em><u> </u></em><em><u>using</u></em><em><u> </u></em><em><u>an</u></em><em><u> </u></em><em><u>computer</u></em><em><u> </u></em><em><u>but</u></em><em><u> </u></em><em><u>if</u></em><em><u> </u></em><em><u>you</u></em><em><u> </u></em><em><u>use</u></em><em><u> </u></em><em><u>an</u></em><em><u> </u></em><em><u>paper</u></em><em><u> </u></em><em><u>you</u></em><em><u> </u></em><em><u>will</u></em><em><u> </u></em><em><u>make</u></em><em><u> </u></em><em><u>mistakes</u></em><em><u> </u></em><em><u>over</u></em><em><u> </u></em><em><u>and</u></em><em><u> </u></em><em><u>over</u></em>

8 0
3 years ago
Which of the following assumes that the repair will happen just as the technician stated?
kipiarov [429]
A (filling out carachts
3 0
3 years ago
Which standard is commonly used on the Internet to represent non-numeric data?
mezya [45]
ASCI is the standard that is commonly used on the Internet to represent non-numeric data. ASCI stands for American Standard Code fro Information Interchange. This character encoding standard represents text in computers, telecommunications equipment, and other devices.  It assigns letters, numbers, and other characters within the 256 slots available in the 8-bit code
4 0
3 years ago
____ privileges for data involve establishing who can enter new data, change existing data, delete unwanted data, and view data.
Stolb23 [73]
Administrator privileges
6 0
3 years ago
What is the full form of ms-word?​
Alex

Answer:

microsoft word

Explanation:

i got certified on it sooooooooooo...

6 0
3 years ago
Read 2 more answers
Other questions:
  • "The OSI model has seven layers and the DoD has four. At which layer does SMTP works in both models"?
    15·1 answer
  • . What is the output of this code sequence?
    8·1 answer
  • We use them every day, but what is the overall purpose of a search engine?​
    10·2 answers
  • A production house needs an operating system that captures, saves, and generates information within specific time. Which type of
    13·2 answers
  • How can you get access to Help? Click all that apply.
    5·2 answers
  • Web and mobile applications are created for users to only read information. True False
    15·2 answers
  • Which of the following best describes the purpose of a design specification?
    11·1 answer
  • Chloe is creating the software requirements specifications (SRS) for a project. The project is a web app that allows students to
    12·1 answer
  • Only now _______ why you didn't tell me.​
    14·2 answers
  • Multiple Choice
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!