Checking krishnamurthy number in python
#Krishnamurthy Number: It is a number which is equal to the sum of the factorials of all its digits.
#For example : 145 = 1! + 4! + 5! = 1 + 24 + 120 = 145
#For example : 145 = 1! + 4! + 5! = 1 + 24 + 120 = 145
a=int(input("enter any number"))
g=a
fact=1
sum=0
while(a>0):
r=a%10
fact=1
for i in range(1,r+1):
fact=fact*i
sum=sum+fact
a=a//10
if(sum==g):
print("krishna____ number")
else:
print('not')
Thank you a lot for providing individuals with a very spectacular possibility to read critical reviews from this site. Best Python training Institute in chennai
ReplyDeleteThis comment has been removed by the author.
ReplyDeletethank for sharing programmatic information. this useful information to me
ReplyDeletepython training in Hyderabad the best career
n=int(input("Enter a number "))
ReplyDeletes=0
factorial=1
x=n
while (x>0):
d=x%10
factorial=1
for i in range(1,d+1):
factorial=factorial*i
s+=factorial
x//=10
if(s==n):
print('Krishnamurthy no = ',n)
else:
print('Not a Krishnamurthy no = ',n)
it is the program for python 3
Hi, thanks for your blog, if you want to learn about programming languages like java, php, android app, embedded system etc. I think this training institute is the best one.
ReplyDeletebest python training in coimbatore
Android training in coimbatore
Networking training in coimbatore
Thank you to give this simple code
ReplyDeleteThanks for sharing, very informative. Top Programming Languages in 2020.
ReplyDelete
ReplyDeleteDigital Lync offers one of the best Online Courses Hyderabad with a comprehensive course curriculum with Continuous Integration, Delivery, and Testing. Elevate your practical knowledge with quizzes, assignments, Competitions, and Hackathons to give a boost to your confidence with our hands-on Full Stack Training. An advantage of the online Cources development course in Hyderabad from Digital Lync is to get industry-ready with Career Guidance and Interview preparation.
DevOps Training Institute
Python Training Institute
AWS Training Institute
Online Full Stack Developer Course Hyderabad
Online Python Course Hyderabad
Online AWS Training Course Hyderabad
Online Devops Course Hyderabad
Digital Marketing Training Hyderabad
very well explained.
ReplyDeletePython training in Nagpur
This comment has been removed by the author.
ReplyDeleteinformative writeup, keep doing , python course in satara
ReplyDelete