Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started