Python By Code
Friday, July 31, 2015
Python Program to Add digits of a given number
number=input("Enter a number :)
sum=0
while number > 0 :
rem=number % 10
sum =sum + rem
number=number /10
print sum
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment