Hello readers in this article I will show you how to write a Python program to check if a number is divisible by another number of not.

**Code**

```
n1=int(input("Please enter first number"))
n2=int(input("please enter second number"))
if(n2==0):
print(n1,"Is not divisible by",n2)
elif(n1%n2==0):
print(n1,"is divisible by ",n2)
elif(n1%n2!=0):
print(n1,"is not divisible by",n2)
```

**Output**

```
Please enter first number4
please enter second number8
4 is not divisible by 8
```

As you can see with this you can check How to write a Python program to check if a number is divisible by another number of not

Thank You.

You must log in to post a comment.