[no audio]
Hi friends, here we are
going to discuss about data structures of Python.
So before entering into this concept, right already we know
what is a variable in Python.
Right. So variables are used to store some data. Even data
structures are also variables, and they are used to store data but
the data is collection of data.
Let me explain that to you on my command line.
So let me enter into my python.
So, you know normal variables like 'x=5',
then I can say the value of 'x' is 5, and I can see with the
help of 'print(x)', right. Now sometimes
you need to define a number of variables. Instead of defining
number of variables,
what I will do is I will take only one variable,
let's say 'my_values', you can take like 'xyz' also, your
variable name but I am taking 'my_values=',
[no audio]
like you can take any type of data.
You can represent your data inside of, suppose your square
brackets with commas separated values and then you can assign
the result into some variable. Now here,
here 'x' is a variable and 'my_values' is also a variable, but
there is a small difference between these two. That is 'x' is
a normal variable and which is used to hold only one single
value. Now I have a list, list of values.
I stored this list of values into this variable, right?
I collected collection of data and I stored that data into
one variable called 'my_values'. Now here 'my_values' is also
a variable but it is storing multiple data. Now this
is called data structure.
[no audio]
Right. So guys, there is not much difference between your normal
variable and data structure variable, both are variables.
The only thing is, your normal variable is able to hold one
value, but your data structure variable is able to
hold multiple values, right? That's it.
Other than that nothing is there. But how you are going to
structure your data, how you are going to store your data
into your variable,
what are the symbols you are using, based on this we have different
types of data structures with your Python.
Right. Let me start that. First thing that data structures are used
to store a collection of data. That collection of data may
be pure integers, pure float, right, or pure string numbers,
string values, or maybe combination of all, no problem.
You can store any type of data, combination of any type of
data you can store into your data structure.
[no audio]
Right. Then, there are four built-in data structures with
your Python, right. Built-in means by default
you have these data structures.
So based on some modules, you may get some other data structures
as well. Suppose if you go
with arrays modules, you have some array data structure.
Okay, as of now by default with your Python you are getting
these are the four different data structures with your Python.
They are by default you have with your Python.
[no audio]
Okay. Now 'List', you have to represent with square brackets,
I mean you have to write your data inside of this. 'Tuple',
while writing your data you have to use parentheses. 'Dictionary',
you have to write your data with curly braces with key-value
pair representation
like your dictionary book. 'Set', sets are represented with curly braces,
but values are like 'List' and 'Tuple'. But there is some unique
property with sets, we will see them.
So guys, these are the four data structures, and as an
automation engineer you should be good with first three
data structures.
Right. And we will see about each data structure separately,
okay, in later videos.
So as of now you have to remember there are four data structures,
right? All data structures are used to store multiple data
or collection of data, right?
That is the purpose of data structures.
And finally you have to remember that data structures are
also variables.
Right. Okay guys,
thank you for watching this video.
[no audio]