Simple Python Scripts
Scripts for simple Python programs
Saturday, 12 November 2016
sum of digits of number
n=int(input("enter no:"))
sum=0
while(n!=0):
r=n%10
n=n//10
sum=sum+r
print("sum of digits:",sum)
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment