list1.append(list2) returns None

Matimus mccredie at gmail.com
Thu Dec 21 12:50:06 EST 2006


Pyenos wrote:

> def enlargetable(table,col):
>     table.append(col) # the code won't return sorted lists :-o
>     return_the_fucking_table_bitch=table # assign it to a new variable to return it
>     return return_the_fucking_table_bitch # :-|

Maybe you were just trying to be funny, but assiging the table to
another variable before returning is not only unnecessary, it
accomplishes nothing. The following will do exactly the same thing as
the above:

[code]
def enlargetable(table,col):
    table.append(col)
    return table
[/code]




More information about the Python-list mailing list