Divisible Value

Write a Python program that takes two numbers as input and checks if the first number is divisible by the second number. If it is, print "Divisible," otherwise, print "Not divisible.
45
5
Total : 1 Discussion
Login
Ganeshanandan Ratnanandan
    
I have tried two different programs and get the right answers in both cases but the 'check test' says that the Not Divisible test cases have failed. I don't understand it.
num1 = int(input())
num2 = int(input())

if num1%num2 ==0:
 print ("Divisible")
else:
 print ("Not divisible")

I also tried
num1 = int(input())
num2 = int(input())

if num1%num2 ==0:
 print ("Divisible")
elif num1%num2 !=0: :
 print ("Not divisible")
Reply     
codeexperts
     23-06-2024 02:42 AM
Hello Ganeshanandan,
in the else or elif statement , u have written "Not divisible" , where "d" is small , where as in problem statement "D" should be the capital in "Not Divisible".
num1 = int(input())
num2 = int(input())

if num1%num2 ==0:
 print ("Divisible")
else:
 print ("Not Divisible")