import functools
print("Enter number")
num=input()
#first way
n=int(num)
ans=1
while(n):
ans=ans*(n%10)
n=int(n/10)
print("Product of digit is",ans)
#second way
n=num
li=list(map(int,','.join(n).split(",")))
ans=functools.reduce(lambda x,y:x*y,li)
print("Product of digit is",ans)
Enter number
1234
Product of digit is 24
Product of digit is 24
Enter number
818
Product of digit is 64
Product of digit is 64