You are on page 1of 1

Q1 Write a program to check the divisibility of a number by 7 that is passed as a parameter to the

user defined function.

def isfactor7(n):
if n%7==0:
return True
else:
return False

n=int(input("Enter any number "))


res= isfactor7(n)
if res:
print(n, "is divisible by 7")
else:
print(n, "is divisible not by 7")

You might also like