logo CodeStepByStep logo


Language/Type: Python collections set

Suppose you have sets stored as variables named people, male, female, young, old, silly, rich, poor, and hungry. Each set contains strings representing people with that quality: the people set includes everyone; the male set includes all men; etc. Now suppose you want to find all of the men who are not hungry and are old or poor or both. How would you use set operators to find that exact set of people?

(order shuffled)

You must log in before you can solve this problem.

Log In

Need help?

Stuck on an exercise? Contact your TA or instructor.

If something seems wrong with our site, please

Is there a problem? Contact us.