Digit_sum


#1

does anyone know how to write the code as the instruction codecademy provided(attached below)?

“One way might be to convert the integer to a string with str(), iterate over it, and turn the substrings back into integers with int() to do the addition.” <----- right here


#2

Doesn’t that already say how? You should probably already know how to do each of those, and then it’s just a matter of doing one after the other


#3

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.