Solution Review: Check if a Number is Divisible by Another

This lesson will explain if one number is divisible by another.

We'll cover the following

Solution: Use the Modulus Operator(%)

Use % to compute x % y for calculating the remainder. If the remainder is 0, then x% y returns true (and false otherwise).

The following python code helps to check whether a number x is divisible by a number y.

Get hands-on with 1400+ tech skills courses.