← Back to challenges

Product Divisible by Sum?

PythonHardnumbersarraysvalidationmath

Instructions

Write a function that returns True if the product of a list is divisible by the sum of that same list. Otherwise, return False.

Examples

divisible([3, 2, 4, 2]) ➞ False

divisible([4, 2, 6]) ➞ True
# 4 * 2 * 6 / (4 + 2 + 6)

divisible([3, 5, 1]) ➞ False

Notes

N/A

python3
Loading editor…
⌘ ↡ to run
Walks through the solution with reasoning and edge cases.
Next: Convenience Store β†’