Leonardo

1,452
reputation
3
15
26

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)