← Back to challenges

Check Factors

PythonHardarraysvalidationloops

Instructions

Write a function that returns True if all integers in a list are factors of a number, and False otherwise.

Examples

check_factors([2, 3, 4], 12) ➞ True
# Since 2, 3, and 4 are all factors of 12.

check_factors([1, 2, 3, 8], 12) ➞ False
# 8 is not a factor of 12.

check_factors([1, 2, 50], 100) ➞ True

check_factors([3, 6], 9) ➞ False

Notes

N/A

python3
Loading editor…
to run
Walks through the solution with reasoning and edge cases.
Next: Primitive Darts Game