Skip to main content
Leonardo's user avatar
Leonardo's user avatar
Leonardo's user avatar
Leonardo
  • Member for 12 years
  • Last seen more than 2 years ago
Stats
1,502
reputation
110k
reached
22
answers
35
questions
Loading…
About

Define a function that computes the length of a given list or string. (It is true that Python has the len() function built in, but writing it yourself is nevertheless a good exercise.)

def strlen(a): return len(a)

3
gold badges
15
silver badges
26
bronze badges
8
Score
14
Posts
25
Posts %
5
Score
4
Posts
7
Posts %
2
Score
19
Posts
33
Posts %
2
Score
3
Posts
5
Posts %
1
Score
24
Posts
42
Posts %
1
Score
3
Posts
5
Posts %
Top posts
View all questions, answers, and articles