← Back to challenges

Divides Evenly

PythonMediummathvalidationnumbers

Instructions

Given two integers, a and b, return True if a can be divided evenly by b. Return False otherwise.

Examples

divides_evenly(98, 7) ➞ True
# 98/7 = 14

divides_evenly(85, 4) ➞ False
# 85/4 = 21.25

Notes

a will always be greater than or equal to b.

python3
Loading editor…
to run
Walks through the solution with reasoning and edge cases.
Next: Let's Fuel Up!