Algorithm help per favore
eppstein at ics.uci.edu
Wed Jun 18 22:54:14 CEST 2003
On 6/18/03 3:45 PM -0500 Skip Montanaro <skip at pobox.com> wrote:
> David> It's tempting to use "not L" instead (since what I want is
> an David> object that's not equal to L) but that fails when L is
> How about "not L[0:1]"? Since L is a sequence (right?), "not L[0:1]" will
> be True if L is empty and False otherwise.
That fails to produce an object that is guaranteed to be unequal to L
when L is nonempty.
David Eppstein http://www.ics.uci.edu/~eppstein/
Univ. of California, Irvine, School of Information & Computer Science
More information about the Python-list