In this video, you will learn about sets, and how they can help with storing certain types of data in different types of formats. First, I declare a set, I can start by declaring a simple variable called set_a= and then use curly braces to define the set itself. Then the values go inside the brackets, I put in 1, 2, 3, 4 and 5. I'll do a simple print out to prove that we have a set, I click on run to get the values 1 to 5 printed out. Sets differ slightly from lists, in that they don't allow duplicate values. I can demo this by putting in another 5, when I click on run, I find that the second 5 is not printed out in the list. Sets also have methods that we can use, I can use a method to add new content. If I use set_a.add (6), I can add in the number 6, I click on run to find that the value 6 is added to the set. I could also use the remove method, I'll remove the number 2, when I clicked on run, I found the number 2 was removed from the set. There's also discard, which essentially does the same thing as remove. Using discard, when I click on run I'll find that I get the same output. Let me clear the console before we go any further. There are also a few useful methods that can be used with sets to perform mathematical operations, let me demo some of them now. First, I will create a new set, set_b, I will put in 4, 5, 6, 7 and 8, and reset the values of set_a to the original values. There are two ways I could use mathematical operators. For instance, for a union join, I can do set_a.union and then pass in set_b, then, I can click on the run button to see what happens. I discover that it joins the two sets together minus the duplicate values like 4 and 5, union merges them into one. So, you have a set 1, 2, 3, 4, 5, 6, 7, 8. For the other options for union, I can use the vertical line symbol or the 0 symbol and that works in the same way. Let me clear the console before we go on. Another operation I can use is the intersection, I can apply this to set_a by writing set_a.intersection and passing set_b as the argument. When I click run, I get back all the items that match in both set_a and set_b, here we have 4 and 5. The intersection can also be represented by the ampersand and will work in the same way. When I click on run, I also got back 4 and 5, let me clear the console again before we continue. Another mathematical operation I can use is the set difference. To use this, all print set_a.difference(set_b), and this should give me back all the elements that are only in set_a and not in set_b. When I clicked run, we got the correct output of 1, 2 and 3. I could also represent difference by using the minus symbol, when I click on run, I'll also get back the same values, 1, 2 and 3. The last operation I'll discuss is what's called symmetrical difference. This is represented by the symmetric difference function, which is used in a similar way. When I click on run, I get back 12367 and eight. In other words, all of the elements that are present in set A. Or set B. But not in both sets, symmetrical difference can also be represented by the carrot operator. When I click on run, I get back the same values. An additional important thing about sets is that a set is a collection with no duplicates but it's also a collection of unaltered items. Unlike a list where I can print out content based on index. If I try to print out set a bracket zero to get the zeroth element in the set, I'll get an error. Let me clear my console. Before we attempt to print this output. When I click on run, I get back a type error saying that the set object is not subscriptable this means that the set is not a sequence, it doesn't contain an ordered index of all elements inside. Okay, that concludes our gentle introduction to sets. Great job.