comparing values in two sets

skip at pobox.com skip at pobox.com
Sun May 14 19:18:47 EDT 2006


    John> I'd like to compare the values in two different sets to test if
    John> any of the positions in either set share the same value (e.g., if
    John> the third element of each set is an 'a', then the test fails).

Do you really mean "set" and not "list"?  Note that they are unordered.
These two sets are equal:

    set(['b', 'a', 'c'])

    set(['a', 'b', 'c'])

Skip



More information about the Python-list mailing list