The slide show you learn about sets and dictionaries.
Remember these are top elsewhere referred to as sequences.
Well sets and dictionaries are referred to as collections because they are unordered collections of
items.
Let's start explaining sets.
So this is not a collection of unique items and remember unique items not duplicate items a lot in a
set.
We can create a site using curly brackets just like this.
They say faltered and I'll say all three integers in my set.
Simple and practical use offsets.
Now is when you have a visa that has duplicate items and you want to remove removals duplicate items
from it.
Let's say you have the least file these.
We have two duplicate items and two Omega sequence of unique elements.
You have to convert it to a set object.
We can't convert a lease to a said object using the said function.
When you do that duplicate will be removed automatically.
So we are sort of updating our file of this variable with the new value in this line of code.
This new value will be a set that is generated by converting those least objects to a set object.
So you know printing the file is Wheler reveal that duplicate items have been removed and we now have
a set object not a list anymore.
That is because we converted our solutions to a set but don't believe me hunch.
The type of the object always.
So if you want to retain your data type you can convert the set back to a list using the list function
this time.
So file this equals list and we pass the said object to the list function more data types.
Now dictionaries.
Well let's try to explain them by making a comparison with this.
So in the case of this we were able to access items using indexes for dictionaries we can access items
using indexes clear explicitly by us.
Here is a dictionary called my dictionary file dict.
We use curly brackets to define a dictionary and there were either index or column the corresponding
item.
So don't forget that each item has its own data type so if you use quotes for an item that matches that
particular item a string and so on the items in this case are 2015 2017.
In 2019 they are referred to as the values so remember values.
Why are we talking about dictionaries.
Indexes are.
Last year this year and next year they are referred to as keys.
So what we are doing here is an object constructed by pairs of keys and values.
Now in the case of we sent up also we were able to access items using the default indexes.
In the case of dictionaries you can access the dictionary values using the corresponding keys that will
return a value attached to the U key.