Deals Of The Week - hours only!Up to 80% off on all courses and bundles.-Close
Introduction
Set basics
Relationships between sets
Summary
15. Summary

## Instruction

All right, it's time to wrap things up. First, a summary of what we've learned:

1. Basic set operations are given below with comments:

# define a non-empty set
prime_numbers = {2, 3, 5, 7}

# define an empty set
prime_numbers = set()

# remove an element

# remove all elements
prime_numbers.clear()

# iterate over a set
for number in prime_numbers: ...

# check if an element is in the set
if number in prime_numbers: ...

2. The following functions are used to create a new set from two sets: intersection(), union(), difference(), and symmetric_difference().
3. To specify the relationship between two sets, we can use issubset() and issuperset().

Are you ready for a short quiz?

## Exercise

Click to continue.