So guys, we have seen different different data types again.
Hello guys.
So we are going to continue the discussion with respect to Python.
Already in our previous video we have discussed about variables.
Now in this video we are going to discuss about data types.
Now here uh is the detailed video outline.
Uh, first of all we are going to understand the introduction to data types, uh, importance of data
types in programming.
Then we are going to explore some of the basic data types like integer floating point numbers, strings
and booleans.
And after that, uh, you know, after some number of videos we are going to see advanced data types,
uh, like list tuples, sets and dictionaries here.
There is a lot of operations that we really need to understand.
So I will be discussing about this topic further going ahead.
And then you also have some examples with respect to type conversion and practical example.
Now first of all uh we need to understand the definition of data types.
What exactly data types are.
So here uh, data types are a classification of data which tells the compiler or interpreter how the
programmer intends to use the data.
Right.
They determine the type of operation that can be performed on the data, the values that the data can
take, and the amount of memory needed to store the data.
Right.
And as you all know, there are different different data types.
Uh, like, um, you know, if I probably say integer floating, they definitely require different amount
of memory, right?
Whenever they are storing some kind of, uh, information like you may have int eight bit, you may
have float 16 bits.
Right.
So different different uh bits information will be there uh for a specific data type.
Right now let's understand what are the importance of data type in programming.
So data types ensure that the data is stored in a very efficient way.
They help in performing correct operations on data.
And proper use of data types can prevent errors and bugs in the program.
And obviously memory management is also one of the very key term.
Okay.
Now let me just go ahead and show you with respect to the code and how we can basically start with,
okay, now the first example that we are going to go ahead, right, with respect to the data types
is nothing but integers.
So here I'm going to basically go ahead and write integers.
So this looks like a plain text.
Let me delete this because I don't want this I will go ahead and create.
So here um you will be able to see integers.
Example okay.
And uh, first of all let me just go ahead and select the kernel okay.
So the kernel is over here.
Now let me go ahead and create a variable of an integer type.
Right now if I really want to create a variable I hope everybody is I have already told it.
Let's say age is equal to 35.
And if I go ahead and write type of age, this will specifically give me an integer value.
As I always said, whatever topics we are seeing again it will be getting repeated.
You know, we will just be seeing that how uh, more things we can actually learn about this right now.
See, I have already spoken about variables.
I have already spoken about integer.
But since we are learning now about data types here also, you'll be able to see that so many different
things are there right then.
um, once I probably create an integer variable, you can also go ahead and create a floating point
number.
So let's say my floating point number uh over here floating point data type okay.
Floating point data type here I'm going to specifically use it.
And let's say over here I define like, uh, you know, um, sentiment or let's say I will, I will
probably define the width right or width or height or anything.
So let's go ahead and define height.
So let's say that if I'm writing 5.11.
So this uh will be nothing.
But if I go ahead and print the height.
Right.
And if I go ahead and print the type of the height, right.
So here you will be able to see that I will be able to get my floating point number right.
So here you can see I'm able to get 5.11.
And this is nothing but class float.
This class was nothing but INT I've already spoken about type casting also.
Right.
So this is one of the other data type like floating data type uh floating data point example.
Um, and the next example that I can probably take is for string.
So string data type example okay I will be showing you more examples as we go ahead.
So let me say this is name is Krish okay.
Okay.
And uh, here you can probably see I'll go ahead and print the name and let me just go ahead and see
print type of name okay.
So here you can actually see that okay fine.
I'm able to see all these things I'm able to get this information and.
All right.
And similarly one more common data type that we will be specifically using is something called as boolean
data type.
Right.
And again guys I'm not showing you much operations because operations will be coming as we go ahead.
Right.
Uh, when will be learning about our next tutorial.
Right where we'll be learning about operators.
At that time, we'll be discussing more about operations, how we can use this and probably, uh, do
different types of operation.
And.
All right.
So for Boolean, uh, what you can do is that I can directly define true or false.
So if I probably use true right.
So this is basically a boolean value.
right.
If I go ahead and see the type right.
So type.
So here you can see it is a bool value.
Right.
So this is one way how you can define it.
Let's say I define saying that is true right.
And I may assign it to true right.
And if I go ahead and see the type of is true type of is underscore true, you'll be able to see, hey,
fine, I'm actually able to get the boolean value right.
This is one way.
The other way is that I may go ahead and directly assign a bool variable.
Right.
And let me just go ahead and execute this okay.
So here you can see uh when we use a boolean variable right.
Or let me do like this.
Right.
So let's say uh I want to go ahead and define a boolean variable.
So I will go ahead and write bool okay.
And if I go ahead and execute it right by default it is probably coming as false right.
Now I can also give some other conditions like let's say uh, I have two variables, right?
Uh, let's say I have two variables.
Let me define it out.
A is equal to ten okay.
And B is equal to ten okay.
Now if I sorry this is getting added I don't know why.
So B is equal to ten okay, so there is some built in functions and all.
I think that is why it is getting applied.
If I write a double equal to B right.
So over here I'm able to get true.
Right.
And even though I see when I'm doing this specific operation, if I go and see the type it is again
Boolean.
Right.
So Boolean is another one data type which we can specifically use.
And this is just for true and false.
Right.
Uh that is why Boolean is specifically used.
Right.
So we will be seeing more of this kind of examples as we go ahead.
Right.
And I know you are excited to see lot of operations, but let's go from basics.
And then we will try to build up more and more concepts.
Right at the end of the day, you really need to try and work hard, right?
And uh, more you work hard.
Uh, it is more like you'll become more perfect in it, right?
So let's see some of the common errors that we may probably face.
You know, some of the common errors that we may get, uh, whenever we are working with, uh, different
different data types, let's say, uh, my result is something called as hello right now for this particular
result.
Right.
And uh, let's say I want to go ahead and add five.
Okay.
Now what will happen.
Let's check okay.
And if I go ahead and execute this here you'll be able to see that I am getting an error, right.
It is saying can only concatenate string right not integer.
And here you can see on the left hand side it is basically a string.
And on the right hand side when I'm performing this specific operation I'm actually giving an integer.
So if I really need to fix this error, all I have to do is that go ahead and write this okay.
And over here I need to do the typecasting.
Right.
So let's say if I go ahead and write str of five, then this issue will definitely get fixed.
Right.
And if I go ahead and print it print the result.
Okay.
So here you'll be able to see I'm able to get hello five.
Now that is the power of typecasting.
See in this particular case when I was trying to concatenate or add five over here.
Right.
And obviously it is not possible because this is a string and this is a numerical value.
We cannot perform any mathematical operation.
Right.
And here you can actually see that I am able to get this.
So these are some of the common errors like minimal common errors that you may be facing.
Uh but we will deep dive more into different different operations.
And one more thing that I really want to talk about.
Uh, let's say if I want to define a string, right, let's say like hello.
Okay, now you'll be able to see string dot.
There are so many different different methods.
Right.
If I probably go ahead and see there are so many different, different methods.
If I go ahead and see over here, see so many different different methods like is is it is uh, is alphanumeric,
is uh, you know, case fold center clear copy count difference difference update.
So we will also be seeing this kind of operations once we go ahead towards the advanced data type.
Because see, we need to understand all these methods because all these methods, once you understand,
you will be able to understand it how you will be using in different different operations.
But right now, since we are just discussing with the basics and we are just in the fourth tutorial,
uh, I want to go a little bit slowly, uh, with definition, with examples show you multiple things
and uh, make sure that you learn things in a way that it it It matters a lot to you, right?
And uh, again, uh, as I said, uh, uh, be patient with respect to this.
I know many people will be excited saying that.
Hey, Chris, you quickly complete fast, right?
But let me go a little bit slowly so that you will be able to understand things.
Okay.
So, uh, yes, uh, this was it from my side.
I hope you like this particular video.
Um, yes.
I will see you all in the next video.
Thank you.