Python Program to Check for Divisibility of a Number

x = int(input("Insert the numerator: ")) y = int(input("Insert the denominator: ")) if x % y == 0: print(x, " is divisible by ", y) else: print("No! ", x, " is not divisible by ", y)

 

Output:

Insert the numerator: 24
Insert the denominator: 4
24  is divisible by  4

 

 

Insert the numerator: 25
Insert the denominator: 3
No!  25  is not divisible by  3