> Yay, optimizations time! :-) > > def longest2(*args): > if args: > decorated = [ (len(S),S) for S in args ] > decorated.sort() > return decorated[-1][1] You didn't fix the important part: this is still a O(nlogn) solution to an O(n) problem. Of course *args is likely to be small so who cares? Cheers, Brian