← Back to challenges

Sum Greater Than Five

PythonMediumarraysmathlanguage_fundamentals

Instructions

Write a function that returns the sum of elements greater than 5, in the given list.

Examples

sum_five([1, 5, 20, 30, 4, 9, 18]) ➞ 77

sum_five([1, 2, 3, 4]) ➞ 0

sum_five([10, 12, 28, 47, 55, 100]) ➞ 252

Notes

Find all the elements greater than 5, not the elements greater than or equal to 5.

python3
Loading editor…
to run
Walks through the solution with reasoning and edge cases.
Next: Amazing Edabit!