Python program for Sum of digits

 s=0

n=int(input("ENTER N : "))

while n!=0:

    t=n%10

    s+=t

    n=n//10    

print("SUM OF DIGITS : ",s)


Comments