Sum Count Get link Facebook X Pinterest Email Other Apps Sum CountQUESTION DESCRIPTIONWrite a program to find the sum of the entered numbersRefer sample input and output for formatting specification.All float values are displayed correct to 2 decimal places.All text in bold corresponds to input and the rest corresponds to output def getSum(n): sum = 0 while (n != 0): sum = sum + int(n % 10) n = int(n/10) return sumn=int(input())print("The total sum of digits is:",getSum(n)) Comments
Comments
Post a Comment