In this lesson, you will learn about sequences and in particular about sequence membership operations, sequence indexing and slicing, sequence interrogation, and sequence math. Data structures are organized approaches to storing and working with data. They are specialized data structures which are appropriate for all sorts of problems, whether it's optimized data retrieval or efficiently handling large datasets. The most widely used family of data structures in Python are sequences. Sequences are ordered finite collections of data. The sequence types are: lists, tuples, strings, binary strings, and range objects. All of the sequence data types share some operations. These can be grouped into membership operations, indexing operations, slicing, interrogation, and math operations. Let's look at some examples of these shared operations in a Jupyter Notebook. We use the keyword, in, to test if an item is contained in a sequence. For example, here we are testing whether the number three is in this sequence. This sequence is of type list, and we can see that it contains numbers. If the number three is in the sequence, it returns true. If the number wasn't in the sequence, let's change it to 12. See it returns false. We can also modify the in keyword with a knot and it will return the opposite. Now let's talk about indexing. Because sequences contain items in an ordered fashion, we can use an index to access a particular item in a sequence. This sequence is what's called a string, which is a piece of text. We're setting the variable name to the string Monteverdi. Now we're going to use square brackets with an index number in them to access an item in that string. Now we can see that the Index 0 axis is the first letter in the string. In general, Python data structures that have indexing tend to be zero index, that is, the first item is Index 0. Some other languages will use a one index, where the first item would be Index 1. Now we don't just index with the first item, we can also index other items. Here we've gotten the fourth letter, or we've got an Index 4, I should say, which is this e. We can also index from the back of the sequence. If you use a negative index number, it's counting from the back. Negative 1 is the last item in the sequence. We can see that it returns the last letter of the sequence and we can count backwards. Negative 2 would be the penultimate item in the sequence, which is that d. Slicing is when we create a sub sequence from the sequence. Here we've set the variable name to a new string, Palestrina. We use the square brackets again, but this time, instead of using a single index, we're using two indexes separated by a colon. The first index is the first item to include, and the last index is the index after the last item to include. We can see here, that this starts with the Index 2 which is l. We start at 0. Zero would be p, one would be a, and two would be l. It ends with the item at the fourth index, which is the s. Now, if we leave out the first argument to this, it will automatically use a default argument of zero. The beginning of the sequence. We can leave out the last argument and it'll automatically go to the end of the sequence. We can use negative indexing. In this case, we're starting from the third, from the end and going all the way to the end by using the default and argument. We can use both default arguments and it will return the whole sequence. We can use an optional argument to determine the step. By default, the step is, it'll take every item, so that's the step of one. But we can change that by adding a second colon and then a step argument. Here we're taking a step of two, which means it's taking every other letter. We can also do a negative step and we can see that it starts at the end and takes every other letter until the beginning. Sequences have various interrogation methods and operations. For example, we can call length, which is the length function on a sequence, and it'll tell us the length of the sequence. We can find the minimum item in the sequence. Capital letters are considered lower than lowercase letters, and so p will be the minimum, in finding maximum of the sequence. Be aware though that sequences can contain different types of items or some sequences can. If they do, then a max or min will not work. Anything where you can't compare the items, you can't call max or min. Here we're trying to call max on a list that has different types of items, it's got strings and integers in it, and it will throw an error. Sequences also have a count method built-in, so we can count the number of times an items shows up in a sequence. They have an index method, so we can find the index of an item in a sequence. It will find the first occurrence of the index by default. Now it's important to understand how math operations work on sequences. Here we have three string sequences and we're doing addition between them. A sequence does math operations between the sequence itself, not the items in the sequence. Hence, we can add these strings together to create a new string. But if we take these two sequences of integers, two lists of integers, they will not add the items in the integers together, but rather, we'll create a new list containing all of the items. This is important to know, especially when using multiplication, because you might expect in this case, 4 to be multiplied by the items in the sequence. In fact, multiplying by 4 returns a new sequence with four instances of the same items, in the old sequence. In this lesson, you've learned what sequences are and what the shared sequence operations are. These are membership operations, indexing operations, slicing operations, interrogation operations, and math operations. Now you should try working with some sequences