logo CodeStepByStep logo

set_concepts

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?

If you do not understand how to solve an exercise or why your solution doesn't work, please contact your TA or instructor.
If something seems wrong with the site (errors, slow performance, incorrect tests, etc.), please

Is there a problem? Contact a site administrator.

©, all rights reserved.