You are viewing a single comment's thread. Return to all comments →
This code passed only test case #0 .Rest are failed.Can someone please tell the reason..
import math def fact(n): f=math.factorial(n) return f def fact_sum(n): sum= 0 while(n>0): sum+=fact(n%10) n=n//10 return sum a=int(input()) for i in range(10,a): ans= 0 if((fact_sum(i))%i==0): ans+=i print(ans)
Seems like cookies are disabled on this browser, please enable them to open this website
Project Euler #34: Digit factorials
You are viewing a single comment's thread. Return to all comments →
This code passed only test case #0 .Rest are failed.Can someone please tell the reason..