Answered step by step
Verified Expert Solution
Link Copied!

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

DB2 9 For Linux UNIX And Windows Advanced Database Administration Certification Certification Study Guide

Authors: Roger E. Sanders, Dwaine R Snow

1st Edition

1583470808, 978-1583470800

More Books

Students also viewed these Databases questions

Question

6. What is TOC and explain its objectives?

Answered: 1 week ago

Question

a neglect of quality in relationship to international competitors;

Answered: 1 week ago