[Tutor] Converting integers into digit sum (Python 3.3.0)

spir denis.spir at gmail.com
Mon Dec 9 14:48:55 CET 2013


On 12/09/2013 02:29 PM, Wolfgang Maier wrote:
> spir <denis.spir <at> gmail.com> writes:
>
>>
>> Tu sum it up (aha!): you algorithm is the right and only one
>
> No, it's not the only one. It's certainly the most obvious one, but there is
> also the pure numbers approach pointed out by me and Alan.

You are right in a sense, but this is what int() does, isn't it? So in another 
sense I thought it is still the same algo, and it was simpler to present it that 
way. But I also agree with your point of view.

Denis


More information about the Tutor mailing list