test for list equality

John Gordon gordon at panix.com
Thu Dec 15 12:57:02 EST 2011


In <61edc02c-4f86-45ef-82a1-61c7013003b4 at t38g2000yqe.googlegroups.com> noydb <jenn.duerr at gmail.com> writes:

> My sort issue... as in this doesn't work
> >>> if x.sort =3D=3D y.sort:
> ... 	print 'equal'
> ... else:
> ... 	print 'not equal'
> ...
> not equal

> ???

Use x.sort() instead of x.sort .

-- 
John Gordon                   A is for Amy, who fell down the stairs
gordon at panix.com              B is for Basil, assaulted by bears
                                -- Edward Gorey, "The Gashlycrumb Tinies"




More information about the Python-list mailing list