June 2017
Beginner
352 pages
8h 39m
English

In addition, three predicate methods are provided which tell us about the relationships between sets. We can check whether one set is a subset of another using the issubset() method. For example, to check whether all of the people who can smell hydrogen cyanide also have blond hair:
>>> smell_hcn.issubset(blond_hair)True
This checks that all the elements of the first set are also present in the second set.
To test whether all the people who can taste phenylthiocarbamide (PTC) can also smell hydrogen cyanide use the issuperset() method:
>>> taste_ptc.issuperset(smell_hcn)True
This checks ...
Read now
Unlock full access