Python program to find sum of digits of a number | How to find the sum of digits of a number Python

Published: 21 April 2020
on channel: Engineers Revolution
8,218
68

Python Program to Find Sum of Digits of a Number using While Loop
This Python sum of digits program allows the user to enter any positive integer. Then it divides the given number into individual digits and adds those individual (Sum) digits using Python While Loop.

Python Program to find Sum of Digits of a Number using While Loop

Number = int(input("Please Enter any Number: "))
Sum = 0

while(Number (less than) 0):
Reminder = Number % 10
Sum = Sum + Reminder
Number = Number //10

print("\n Sum of the digits of Given Number = %d" %Sum)


Watch video Python program to find sum of digits of a number | How to find the sum of digits of a number Python online without registration, duration hours minute second in high quality. This video was added by user Engineers Revolution 21 April 2020, don't forget to share it with your friends and acquaintances, it has been viewed on our site 8,218 once and liked it 68 people.