I'm trying to program quicksort using list comprehension.
The following gives me a type mismatch error for "+".

def qsort (t):
if len (t) > 1:
return qsort([x for x in t[1:] if x <= t[0]]) + [t[0]] + qsort([x for x in t[1:] if x > t[0]])


I know this sounds strange but I have and idea it (or something similar) worked when I last tried Python a yr or so ago. An earlier version of Python?

Logesh Pillay
_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to