5. WAP to input a number, if it is a three digit number, then check that the product of the digits is a Buzz number or not.
Answers
Answered by
2
def find_product(n):
p = 1
while (n != 0):
p = p * (n % 10)
n = n // 10
return p
while True:
n = int(input("enter num: "))
if len(str(n)) != 3:
print("ENTER A 3 DIGIT NUMBER!")
continue
else:
if n % 7 == 0 or n % 10 == 7:
print("tis a buzz number!")
else:
print("tis not a buzz number")
break
Answered by
3
Answer:
def find_product(n):
p = 1
while (n != 0):
p = p * (n % 10)
n = n // 10
return p
while True:
n = int(input("enter num: "))
if len(str(n)) != 3:
print("ENTER A 3 DIGIT NUMBER!")
continue
else:
if n % 7 == 0 or n % 10 == 7:
print("tis a buzz number!")
else:
print("tis not a buzz number")
break
Similar questions