logo CodeStepByStep logo


Language/Type: Python collections set

Answer the following questions about sets:

A list has every function that a set has, and more. So why would you use a set rather than a list? (Check all that apply.)
(order shuffled)
A set doesn't have the indexes that a list has. How do you examine every element of a set?
(order shuffled)
How do you check whether a set contains a given value?
(order shuffled)
What happens if you try to add a value to a set but that value is already present in the set?
(order shuffled)
How do you merge the contents of two sets?
(order shuffled)
How do you find out what elements are stored in common between two sets?
(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.