Question: Use the Filter pattern to write a function sum_high that consumes a list of numbers and returns the sum of the numbers greater than 50

Use the Filter pattern to write a function sum_high that consumes a list of numbers and returns the sum of the numbers greater than 50 in the list. Use this function to sum the following numbers: [30, 40, 50, 60, 70].

Could someone help me with my code? I'm unsure where to go from here to complete the question.

this is what I've made so far in an attempt on python:

def sum_high(a_list): if temp > 50: return sum = 0 for item in a_list: sum = sum + item print(sum([30, 40, 50, 60, 70]))

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!