Question: Write a Python program to input a number and calculate sum of digits using for loop. Sample Input: 1234 Sample Output: Sum of Digits:
Write a Python program to input a number and calculate sum of digits using for loop. Sample Input: 1234 Sample Output: Sum of Digits: 10 ** 1234 = 1+2+3+4 Write a Python program to calculate the factorial of a number using any loop. Simple Input: 5 Simple Output: 120 *** factorial of 5 = 5*4*3*2*1 factorial of 6 = 6*5*4*3*2*1 factorial of n = n* (n-1)* (n-2)* (n-3).....*1
Step by Step Solution
3.37 Rating (163 Votes )
There are 3 Steps involved in it
Program to calculate the sum of digits of a number using for loop num ... View full answer
Get step-by-step solutions from verified subject matter experts
