Sum of digits program in Python

    

         Sum of digits program in Python

Program:

    sum=0;m=0;    
      n=int(input("Enter a number:"))       
        while(n>0):   
              m=n%10;    
                sum=sum+m;    
                  n=n//10;     
                print("Sum is ",sum)


                OutPut:
                Enter a number:654
                Sum is  15

                Enter a number:123
                Sum is  6

                Factorial Program using recursion in Python

                   

                         Factorial Program using recursion in Python

                Factorial of n is the product of all positive descending integers. Factorial of n is denoted by n!. For example:

                1. 5! = 5*4*3*2*1 = 120  
                2. 3! = 3*2*1 = 6  

                Factorial Number Program in Python

                  

                         Factorial Number Program in Python

                Factorial of n is the product of all positive descending integers. Factorial of n is denoted by n!. For example:

                1. 5! = 5*4*3*2*1 = 120  
                2. 3! = 3*2*1 = 6  

                Prime Number Program in Python

                 

                         Prime Number Program in Python

                Prime number in C: Prime number is a number that is greater than 1 and divided by 1 or itself. In other words, prime numbers can't be divided by other numbers than itself or 1. For example 2, 3, 5, 7, 11, 13, 17, 19, 23.... are the prime numbers.

                Check Leap Year in Python

                 

                         Check Leap Year  In Python

                Check if a Number is Palindrome or Not in Python

                         Check if a Number is Palindrome or Not in Python

                A palindromic number is a number that remains the same when its digits are reversed. In other words, it has reflectional symmetry across a vertical axis. The term palindromic is derived from palindrome, which refers to a word whose spelling is unchanged when its letters are reversed.

                Fibonacci Series in Python

                   

                         Fibonacci Series in Python 

                Fibonacci Sequence. The Fibonacci Sequence is the series of numbers: 0, 1, 1, 2​, 3, 5, 8, 13, 21, 34, ... 

                Reverse number using Recursion in Python

                  

                         Reverse number using Recursion in Python 

                Python program to reverse a number and to print it on the screen. For example, if the input is 123, the output will be 321

                Check Armstrong Number in Python

                 

                         Check Armstrong Number in Python

                An Armstrong number of three digits is an integer such that the sum of the cubes of its digits is equal to the number itself. For example, 153  is an Armstrong

                Palindrome Numbers in a Given Range in Python

                         Palindrome Numbers in a Given Range in Python

                A palindromic number is a number that remains the same when its digits are reversed. In other words, it has reflectional symmetry across a vertical axis. The term palindromic is derived from palindrome, which refers to a word whose spelling is unchanged when its letters are reversed.