It't me 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
Why is the function called "sort" when it doesn't sort?
Why not call it "run
On 1/25/2011 11:46 AM It't me said...
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
Nit: it'll be a character if passed in a string of ch
On Tue, Jan 25, 2011 at 11:46 AM, It't me 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 = [
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()
=