Pyenos <[EMAIL PROTECTED]> writes: > def enlargetable(table,col): > return table.append(col) > > def removecolfromtable(table,col): > return table.remove(col) > > print enlargetable([[1],[2],[3]],[4]) # returns None > > Why does it return None instead of [[1],[2],[3],[4]] which I expected?
The answer is both "because that's what it's documented to do": s.append(x) same as s[len(s):len(s)] = [x] <URL:http://docs.python.org/lib/typesseq-mutable.html> and "because you asked it to *do* something, not *get* something": <URL:http://www.python.org/doc/faq/general.html#why-doesn-t-list-sort-return-the-sorted-list> -- \ "There was a point to this story, but it has temporarily | `\ escaped the chronicler's mind." -- Douglas Adams | _o__) | Ben Finney -- http://mail.python.org/mailman/listinfo/python-list