Computer Science, asked by randomgirl64, 11 months ago

Write a program to accept a number and check and display whether it's a spy number or not.

Answers

Answered by Vaishnavi20kulkarni
12

Answer:

Explanation:

Hope it helps friend!

Attachments:
Answered by allysia
1

Answer:

Using python:

______________________

def spy(n):

   b=str(n)

   sum=0

   pro=1

   for i in range(0,len(b)):

       sum+=int(b[i])

       pro*=int(b[i])

       

   if sum==pro:

       return ("Yes it's a spy number")

   else:

       return ("No, it's not a spy number")

_________________________________

Attachments:
Similar questions