zlacker

[return to "My Favorite Programming Problem to Teach: Digit Length"]
1. _paste+Id[view] [source] 2019-11-11 00:48:19
>>jstrie+(OP)
Why not:

  def digit_len(n): 
    return len(str(n))
◧◩
2. crummy+Ud[view] [source] 2019-11-11 00:51:40
>>_paste+Id
That's mentioned in the article, at the bottom, under the topic "Alternative, invalid solution":

> As a result, solutions using strings are disallowed on problem sets and quizzes until they are taught.

[go to top]