WEBVTT

00:00.110 --> 00:02.780
So guys, we have seen different different data types again.

00:02.810 --> 00:03.500
Hello guys.

00:03.500 --> 00:06.230
So we are going to continue the discussion with respect to Python.

00:06.230 --> 00:08.990
Already in our previous video we have discussed about variables.

00:08.990 --> 00:11.840
Now in this video we are going to discuss about data types.

00:11.870 --> 00:15.140
Now here is the detailed video outline.

00:15.260 --> 00:19.490
First of all we are going to understand the introduction to data types uh importance of data types in

00:19.490 --> 00:20.360
programming.

00:20.390 --> 00:25.220
Then we are going to explore some of the basic data types like integer floating point numbers, strings

00:25.220 --> 00:26.240
and booleans.

00:26.240 --> 00:30.950
And after that, uh, you know, after some number of videos, we are going to see advanced data types

00:31.070 --> 00:33.200
like lists, tuples, sets and dictionaries.

00:33.200 --> 00:36.440
Here there is a lot of operations that we really need to understand.

00:36.440 --> 00:39.890
So I will be discussing about this topic further going ahead.

00:39.890 --> 00:44.750
And then you also have some examples with respect to type conversion and practical example.

00:45.440 --> 00:48.620
Now first of all we need to understand the definition of data types.

00:48.620 --> 00:50.390
What exactly data types are.

00:50.390 --> 00:56.120
So here uh, data types are a classification of data which tells the compiler or interpreter how the

00:56.120 --> 00:58.280
programmer intends to use the data.

00:58.310 --> 00:58.820
Right?

00:58.820 --> 01:02.090
They determine the type of operation that can be performed on the data.

01:02.120 --> 01:06.740
The values that the data can take and the amount of memory needed to store the data.

01:06.770 --> 01:07.220
Right.

01:07.220 --> 01:09.470
And as you all know, there are different different data types.

01:09.560 --> 01:15.020
Like, you know, if I probably say integer floating, they definitely require different amount of memory,

01:15.050 --> 01:15.290
right?

01:15.320 --> 01:20.900
Whenever they are storing some kind of information like you may have int eight bit, you may have float

01:20.900 --> 01:21.920
16 bits right.

01:21.950 --> 01:26.960
So different different bits of information will be there for a specific data type.

01:26.990 --> 01:27.470
Right.

01:27.500 --> 01:30.740
Now let's understand what are the importance of data type in programming.

01:30.740 --> 01:35.120
So data types ensure that the data is stored in a very efficient way.

01:35.150 --> 01:40.580
They help in performing correct operations on data, and proper use of data types can prevent errors

01:40.580 --> 01:41.660
and bugs in the program.

01:41.660 --> 01:45.140
And obviously memory management is also one of the very key term.

01:45.170 --> 01:45.710
Okay.

01:45.740 --> 01:51.200
Now let me just go ahead and show you with respect to the code and how we can basically start with,

01:51.230 --> 01:51.710
okay.

01:51.740 --> 01:58.400
Now the first example that we are going to go ahead, right, with respect to the data types is nothing

01:58.400 --> 01:59.090
but integers.

01:59.120 --> 02:01.880
So here I'm going to basically go ahead and write integers.

02:01.880 --> 02:03.890
So this looks like a plain text.

02:03.920 --> 02:06.020
Let me delete this because I don't want this.

02:06.020 --> 02:07.460
So I will go ahead and create.

02:07.460 --> 02:10.460
So here you will be able to see integers.

02:10.460 --> 02:12.170
Example okay.

02:12.230 --> 02:16.070
And uh first of all let me just go ahead and select the kernel okay.

02:16.100 --> 02:17.480
So the kernel is over here.

02:17.510 --> 02:21.080
Now let me go ahead and create a variable of an integer type.

02:21.080 --> 02:26.660
Right now if I really want to create a variable I hope everybody is I have already told it.

02:26.660 --> 02:28.640
Let's say age is equal to 35.

02:28.640 --> 02:34.940
And if I go ahead and write type of age, this will specifically give me an integer value.

02:34.970 --> 02:39.590
As I always said, whatever topics we are seeing again it will be getting repeated.

02:39.620 --> 02:45.710
You know, we will just be seeing that how uh, more things we can actually learn about this right now.

02:45.710 --> 02:47.840
See, I have already spoken about variables.

02:47.840 --> 02:49.340
I have already spoken about integer.

02:49.340 --> 02:53.690
But since we are learning now about data types here also, you'll be able to see that so many different

02:53.690 --> 02:55.790
things are there right then.

02:55.790 --> 02:58.880
Uh, once I probably create an integer variable.

02:58.880 --> 03:01.040
You can also go ahead and create a floating point number.

03:01.040 --> 03:07.550
So let's say my floating point number over here floating point data type okay.

03:07.850 --> 03:11.120
Floating point data type here I'm going to specifically use it.

03:11.120 --> 03:19.100
And let's say over here I define like uh, you know, um sentiment or let's say I will, I will probably

03:19.100 --> 03:23.180
define the width right, or width or height or anything.

03:23.180 --> 03:24.950
So let's go ahead and define height.

03:24.950 --> 03:29.690
So let's say that if I'm writing 5.11 so this uh will be nothing.

03:29.690 --> 03:32.270
But if I go ahead and print the height.

03:32.390 --> 03:32.840
Right.

03:32.840 --> 03:36.680
And if I go ahead and print the type of the height.

03:36.890 --> 03:37.310
Right.

03:37.310 --> 03:41.540
So here you will be able to see that I will be able to get my floating point number right.

03:41.540 --> 03:44.480
So here you can see I'm able to get 5.11.

03:44.480 --> 03:46.130
And this is nothing but class float.

03:46.130 --> 03:50.720
This class was nothing but INT I've already spoken about type casting also.

03:50.750 --> 03:51.080
Right.

03:51.080 --> 03:56.150
So this is one of the other data type like floating data type uh floating data point example.

03:56.390 --> 04:00.800
Um and the next example that I can probably take is for string.

04:00.800 --> 04:02.840
So string data type example.

04:02.870 --> 04:03.380
Okay.

04:03.770 --> 04:06.020
I will be showing you more examples as we go ahead.

04:06.020 --> 04:08.420
So let me say this is name is Krish.

04:08.450 --> 04:09.140
Okay.

04:09.710 --> 04:14.030
And here you can probably see I'll go ahead and print the name.

04:14.030 --> 04:18.080
And let me just go ahead and see print type of name.

04:19.400 --> 04:19.970
Okay.

04:19.970 --> 04:22.310
So here you can actually see that okay fine.

04:22.310 --> 04:25.460
I'm able to see all these things I'm able to get this information and.

04:25.460 --> 04:26.240
All right.

04:26.240 --> 04:31.970
And similarly one more common data type that we will be specifically using is something called as boolean

04:31.970 --> 04:32.450
data type.

04:32.480 --> 04:32.990
Right.

04:33.140 --> 04:37.430
And again guys I'm not showing you much operations because operations will be coming as we go ahead.

04:37.430 --> 04:43.040
Right when we'll be learning about our next tutorial, right where we'll be learning about operators.

04:43.070 --> 04:48.290
At that time, we'll be discussing more about operations, how we can use this and probably, uh, do

04:48.320 --> 04:49.370
different types of operation.

04:49.370 --> 04:49.490
And.

04:49.490 --> 04:50.060
All right.

04:50.060 --> 04:54.800
So for Boolean, uh, what you can do is that I can directly define true or false.

04:54.800 --> 04:56.360
So if I probably use true right.

04:56.370 --> 04:58.500
So this is basically a boolean value, right.

04:58.500 --> 05:00.810
If I go ahead and see the type right.

05:00.810 --> 05:01.710
So type.

05:01.710 --> 05:03.330
So here you can see it is a bool value.

05:03.360 --> 05:03.690
Right.

05:03.690 --> 05:05.520
So this is one way how you can define it.

05:05.520 --> 05:09.150
Let's say I define saying that is true right.

05:09.150 --> 05:11.640
And I may assign it to true right.

05:11.640 --> 05:18.930
And if I go ahead and see the type of is true type of is underscore true, you will be able to see,

05:18.960 --> 05:22.140
hey, fine, I'm actually able to get the boolean value right.

05:22.170 --> 05:23.310
This is one way.

05:23.310 --> 05:28.920
The other way is that I may go ahead and directly assign a bool variable.

05:28.950 --> 05:29.520
Right.

05:29.520 --> 05:32.790
And let me just go ahead and execute this okay.

05:32.790 --> 05:37.020
So here you can see uh when we use a boolean variable right.

05:37.020 --> 05:38.610
Or let me do like this.

05:38.910 --> 05:39.300
Right.

05:39.300 --> 05:43.320
So let's say uh I want to go ahead and define a boolean variable.

05:43.320 --> 05:45.990
So I will go ahead and write bool okay.

05:46.020 --> 05:50.040
And if I go ahead and execute it right by default it is probably coming as false.

05:50.070 --> 05:56.820
Right now I can also give some other conditions like let's say uh, I have two variables, right?

05:57.240 --> 05:59.280
Uh, let's say I have two variables.

05:59.310 --> 06:00.660
Let me define it out.

06:00.690 --> 06:03.540
A is equal to ten, okay.

06:03.570 --> 06:04.830
And B is equal to ten.

06:04.860 --> 06:05.370
Okay.

06:05.400 --> 06:07.530
Now if I.

06:07.560 --> 06:10.410
Sorry this is getting added I don't know why.

06:10.440 --> 06:11.760
So B is equal to ten.

06:11.790 --> 06:12.000
Okay.

06:12.030 --> 06:13.680
So there is some built in functions and all.

06:13.680 --> 06:15.330
I think that is why it is getting applied.

06:15.330 --> 06:18.360
If I write a double equal to B right.

06:18.390 --> 06:20.220
So over here I'm able to get true.

06:20.250 --> 06:20.670
Right.

06:20.670 --> 06:25.680
And even though I see when I'm doing this specific operation, if I go and see the type it is again

06:25.680 --> 06:26.160
Boolean.

06:26.190 --> 06:26.520
Right.

06:26.550 --> 06:30.000
So Boolean is another one data type which we can specifically use.

06:30.000 --> 06:32.130
And this is just for true and false right.

06:32.340 --> 06:34.710
Uh that is why Boolean is specifically used right.

06:34.740 --> 06:37.920
So we will be seeing more of this kind of examples as we go ahead.

06:37.950 --> 06:38.730
Right.

06:40.590 --> 06:45.960
And I know you are excited to see a lot of operations, but let's go from basics.

06:45.960 --> 06:48.570
And then we will try to build up more and more concepts.

06:48.600 --> 06:52.140
Right at the end of the day, you really need to try and work hard, right?

06:52.140 --> 06:56.220
And the more you work hard, uh, it is more like you'll become more perfect in it.

06:56.250 --> 06:56.670
Right.

06:56.670 --> 07:00.900
So let's see some of the common errors that we may probably face.

07:00.930 --> 07:06.210
You know, some of the common errors that we may get, uh, whenever we are working with, uh, different

07:06.210 --> 07:12.840
different data types, let's say, uh, my result is something called as hello right now for this particular

07:12.840 --> 07:13.200
result.

07:13.230 --> 07:13.650
Right.

07:13.650 --> 07:18.060
And uh, let's say I want to go ahead and add five.

07:18.090 --> 07:18.330
Okay.

07:18.360 --> 07:19.200
Now what will happen.

07:19.230 --> 07:20.520
Let's check okay.

07:20.520 --> 07:27.120
And if I go ahead and execute this here you'll be able to see that I am getting an error right.

07:27.210 --> 07:31.710
It is saying can only concatenate string right not integer.

07:31.710 --> 07:35.760
And here you can see on the left hand side it is basically a string.

07:35.760 --> 07:40.560
And on the right hand side when I'm performing this specific operation I'm actually giving an integer.

07:40.560 --> 07:46.530
So if I really need to fix this error, all I have to do is that go ahead and write this okay.

07:46.590 --> 07:50.610
And over here I need to do the typecasting right.

07:50.640 --> 07:56.910
So let's say if I go ahead and write str of five Then this issue will definitely get fixed, right?

07:56.910 --> 08:00.150
And if I go ahead and print it, print the result.

08:00.510 --> 08:03.780
Okay, so here you will be able to see I'm able to get hello five.

08:03.810 --> 08:06.060
Now that is the power of type casting.

08:06.090 --> 08:10.770
See in this particular case when I was trying to concatenate or add five over here.

08:10.800 --> 08:11.100
Right.

08:11.100 --> 08:14.490
And obviously it is not possible because this is a string and this is a numerical value.

08:14.520 --> 08:16.500
We cannot perform any mathematical operation.

08:16.530 --> 08:16.980
Right.

08:16.980 --> 08:20.070
And here you can actually see that I am able to get this.

08:20.070 --> 08:25.410
So these are some of the common errors like minimal common errors that you may be facing.

08:25.590 --> 08:29.430
Uh but we will deep dive more into different different operations.

08:29.430 --> 08:31.830
And one more thing that I really want to talk about.

08:32.040 --> 08:36.390
Uh, let's say if I want to define a string, right, let's say like, hello.

08:36.420 --> 08:39.150
Okay, now you'll be able to see string dot.

08:39.180 --> 08:41.280
There are so many different, different methods.

08:41.280 --> 08:41.820
Right.

08:41.820 --> 08:45.270
If I probably go ahead and see there are so many different, different methods.

08:45.270 --> 08:51.600
If I go ahead and see over here, see so many different different methods like is digit is uh, uh is

08:51.630 --> 08:55.740
alphanumeric is, uh, you know, case fold, center clear.

08:55.770 --> 08:57.990
Copy count difference, difference.

08:57.990 --> 08:58.470
Update.

08:58.470 --> 09:04.020
So we will also be seeing this kind of operations once we go ahead towards the advanced data type.

09:04.020 --> 09:08.250
Because see we need to understand all these methods because all these methods once you understand you

09:08.250 --> 09:12.450
will be able to understand it how you will be using in different different operations.

09:12.450 --> 09:16.620
But right now, since we are just discussing with the basics and we are just in the fourth tutorial,

09:16.650 --> 09:22.950
uh, I want to go a little bit slowly, uh, with definition, with examples, show you multiple things

09:22.950 --> 09:28.080
and make sure that you learn things in a way that it it matters a lot to you.

09:28.110 --> 09:28.590
Right?

09:28.590 --> 09:33.360
And again, as I said, uh, uh, be patience with respect to this.

09:33.360 --> 09:35.610
I know many people will be excited saying that.

09:35.610 --> 09:37.410
Hey, Krish, quickly complete fast.

09:37.410 --> 09:37.950
Right.

09:38.460 --> 09:42.090
But let me go a little bit slowly so that you will be able to understand things.

09:42.120 --> 09:42.600
Okay.

09:42.630 --> 09:45.780
So, uh, yes, this was it from my side.

09:45.780 --> 09:48.390
I hope you like this particular video.

09:48.570 --> 09:49.770
Um, yes.

09:49.770 --> 09:51.840
I will see you all in the next video.

09:51.840 --> 09:52.500
Thank you.
