Bart Willems wrote: > I have a feeling that there's a Python-solution that is shorter yet > better readable, I just can't figure it out yet...
Shorter (and faster for big lists): Yes. More readable: I don't know, I guess that depends on ones familiarity with the procedure. import bisect def grader(score): c = bisect.bisect([60,70,80,90],score) return 'FDCBA'[c] A. -- http://mail.python.org/mailman/listinfo/python-list