Q. Write a program to take two numbers and print if the first number is fully divisible by second number or not.
You can understand by Watching video :-
Answer :-
a = int(input("Enter the number = ")) b = int(input("Enter the divisor = ")) print((a%b == 0 and "It is divisible ") or "It is not divisible" )
Output :-
Enter the number = 4
Enter the divisor = 2
It is divisible
>>>
Enter the number = 654165
Enter the divisor = 6
It is not divisible
>>>
Enter the number = 2
Enter the divisor = 562163
It is not divisible
>>>
a = int(input("enter the number = "))
ReplyDeleteb = int(input("enter the divisor = "))
print((a%b == 0 and "it is divisible ") or "it is not divisible")
in last there will be only bracket as i typed
Sorry I will correct it.
Deletevery good
ReplyDeleteok
: )
DeletenOIce
ReplyDeleteThank You : )
Deletex = int(input("Enter the First Number "))
ReplyDeletey = int(input("Enter the Second Number "))
if x%y ==0:
print(x,"and",y,"is divisible")
else:
print(x,"and",y,"not divisible")
this also works
Yes : )
DeletePost a Comment
You can help us by Clicking on ads. ^_^
Please do not send spam comment : )