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
8.7k 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
8.3k points

No related questions found

Welcome to QAmmunity.org, where you can ask questions and receive answers from other members of our community.