Checking krishnamurthy number in python

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




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')

Comments

  1. 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

    ReplyDelete
  2. This comment has been removed by the author.

    ReplyDelete
  3. thank for sharing programmatic information. this useful information to me
    python training in Hyderabad the best career

    ReplyDelete
  4. n=int(input("Enter a number "))
    s=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

    ReplyDelete
  5. 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.
    best python training in coimbatore
    Android training in coimbatore
    Networking training in coimbatore

    ReplyDelete
  6. Thank you to give this simple code

    ReplyDelete
  7. Thanks for sharing, very informative. Top Programming Languages in 2020.

    ReplyDelete



  8. Digital 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

    ReplyDelete
  9. This comment has been removed by the author.

    ReplyDelete
  10. informative writeup, keep doing , python course in satara

    ReplyDelete

Post a Comment