Quotes help make search much faster. Example: "Practice Makes Perfect"

Thursday, November 29, 2012

Codecademy: digit_sum


#sample solution


def digit_sum(n):
numConvertedToString = str(n)
sum = 0
for c in numConvertedToString:
sum = sum + int(c)
return sum

No comments:

Post a Comment


This is an example of scrolling text using Javascript.

Popular Posts