Check Factors

Published by Helen Yu in

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

Watch a quick demo on how Edabit works.