Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

sum of number digits python

num = input("Enter your number: ")
result = 0
for n in str(num):
        result += int(n)
print("Result: ",result)

#code by fawlid
Source by kite.com #
 
PREVIOUS NEXT
Tagged: #sum #number #digits #python
ADD COMMENT
Topic
Name
1+5 =