CBSE Class 12 Computer Science
Question 98 of 105
Python Revision Tour — Question 4
Back to all questions 4
Question Write a Python program that accepts two integers from the user and prints a message saying if first number is divisible by second number or if it is not.
a = int(input("Enter first number: "))
b = int(input("Enter second number: "))
if a % b == 0:
print(a, "is divisible by", b)
else:
print(a, "is not divisible by", b)Enter first number: 15
Enter second number: 5
15 is divisible by 5
Enter first number: 13
Enter second number: 7
13 is not divisible by 7