On Tue, Jan 25, 2011 at 11:46 AM, It't me <linux...@gmail.com> wrote: > Hi all, > > I'm learning Python with Google's Python class > > Ik have a question about the following code: > ================================= > def sort(var): > return var[-1] #returns the last character of var > > def sort_last(): > tup = [(1, 3), (3, 2), (2, 1)] > print(sorted(tup, key=sort)) > > sort_last() > ================================== > > I uderstand everything except (var) value. > I understand that key=sort calls the sort function. > But where comes the var value from? > Does sort automatic pass the value from tup to (var) > > because (var) is nowhere defined. > > Thanks, > > Martin
Could you post the URL to that class? 'Cause I don't see it either, from what you've posted. If that's all there is, something is profoundly wrong. -- www.fsrtechnologies.com _______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor