Write a Python program that asks the user to enter a number. Then calculate the sum of all individual digits in that number and print the result. For example, if the user enters 123, the sum of digits is 1 + 2 + 3 = 6. The program must take the number as input from the user.
Examples
Example 1
Input
123
Output
6
Explanation 1+2+3 = 6
Example 2
Input
456
Output
15
Explanation 4+5+6 = 15
Example 3
Input
0
Output
0
Explanation 0 has only one digit so sum is 0
Acceptance—
Accepted0
Submissions0
Auto-save
SavedLn 1, Col 1
Submit a solution to see its status here.
Input
Expected Output
6
No results yet
Run your code to test it against the sample cases.