212k views
21 votes
Write a python program to accept a number and check whether it is divisible by 4 or not​

User Bnqtoan
by
4.9k points

1 Answer

5 votes

Answer:

number = int(input("Enter number: "))

if (number % 4):

print("{} is not divisible by 4".format(number))

else:

print("{} is divisible by 4".format(number))

Step-by-step explanation:

If the %4 operation returns a non-zero number, there is a remainder and thus the number is not divisable by 4.

User Bukowski
by
4.3k points