Posted by: Sourav | December 13, 2013

Krishnamurti in Python


import sys
mul=1
result=0
n=int(input(“Enter Number”))
origin=n
while(n>=0):
x=int(n%10)
n=int(n/10)
while(x>1):
mul=mul*x
x=x-1
result=result+mul
mul=1

if(n==0):
break

#sys.stdout.write(str(result))
if origin==result:
print(“Krishna”+str(result))
else:
print(“not”)

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Categories

%d bloggers like this: