1
00:00:00,000 --> 00:00:02,000
So guys, we have seen different different data types again.

2
00:00:02,000 --> 00:00:03,000
Hello guys.

3
00:00:03,000 --> 00:00:06,000
So we are going to continue the discussion with respect to Python.

4
00:00:06,000 --> 00:00:08,000
Already in our previous video we have discussed about variables.

5
00:00:08,000 --> 00:00:11,000
Now in this video we are going to discuss about data types.

6
00:00:11,000 --> 00:00:15,000
Now here uh is the detailed video outline.

7
00:00:15,000 --> 00:00:19,000
Uh, first of all we are going to understand the introduction to data types, uh, importance of data

8
00:00:19,000 --> 00:00:20,000
types in programming.

9
00:00:20,000 --> 00:00:25,000
Then we are going to explore some of the basic data types like integer floating point numbers, strings

10
00:00:25,000 --> 00:00:26,000
and booleans.

11
00:00:26,000 --> 00:00:30,000
And after that, uh, you know, after some number of videos we are going to see advanced data types,

12
00:00:30,000 --> 00:00:33,000
uh, like list tuples, sets and dictionaries here.

13
00:00:33,000 --> 00:00:36,000
There is a lot of operations that we really need to understand.

14
00:00:36,000 --> 00:00:39,000
So I will be discussing about this topic further going ahead.

15
00:00:39,000 --> 00:00:44,000
And then you also have some examples with respect to type conversion and practical example.

16
00:00:45,000 --> 00:00:48,000
Now first of all uh we need to understand the definition of data types.

17
00:00:48,000 --> 00:00:50,000
What exactly data types are.

18
00:00:50,000 --> 00:00:56,000
So here uh, data types are a classification of data which tells the compiler or interpreter how the

19
00:00:56,000 --> 00:00:58,000
programmer intends to use the data.

20
00:00:58,000 --> 00:00:58,000
Right.

21
00:00:58,000 --> 00:01:03,000
They determine the type of operation that can be performed on the data, the values that the data can

22
00:01:03,000 --> 00:01:06,000
take, and the amount of memory needed to store the data.

23
00:01:06,000 --> 00:01:07,000
Right.

24
00:01:07,000 --> 00:01:09,000
And as you all know, there are different different data types.

25
00:01:09,000 --> 00:01:14,000
Uh, like, um, you know, if I probably say integer floating, they definitely require different amount

26
00:01:14,000 --> 00:01:15,000
of memory, right?

27
00:01:15,000 --> 00:01:19,000
Whenever they are storing some kind of, uh, information like you may have int eight bit, you may

28
00:01:19,000 --> 00:01:21,000
have float 16 bits.

29
00:01:21,000 --> 00:01:21,000
Right.

30
00:01:21,000 --> 00:01:27,000
So different different uh bits information will be there uh for a specific data type.

31
00:01:27,000 --> 00:01:30,000
Right now let's understand what are the importance of data type in programming.

32
00:01:30,000 --> 00:01:35,000
So data types ensure that the data is stored in a very efficient way.

33
00:01:35,000 --> 00:01:38,000
They help in performing correct operations on data.

34
00:01:38,000 --> 00:01:41,000
And proper use of data types can prevent errors and bugs in the program.

35
00:01:41,000 --> 00:01:45,000
And obviously memory management is also one of the very key term.

36
00:01:45,000 --> 00:01:45,000
Okay.

37
00:01:45,000 --> 00:01:51,000
Now let me just go ahead and show you with respect to the code and how we can basically start with,

38
00:01:51,000 --> 00:01:57,000
okay, now the first example that we are going to go ahead, right, with respect to the data types

39
00:01:57,000 --> 00:01:59,000
is nothing but integers.

40
00:01:59,000 --> 00:02:01,000
So here I'm going to basically go ahead and write integers.

41
00:02:01,000 --> 00:02:03,000
So this looks like a plain text.

42
00:02:03,000 --> 00:02:07,000
Let me delete this because I don't want this I will go ahead and create.

43
00:02:07,000 --> 00:02:10,000
So here um you will be able to see integers.

44
00:02:10,000 --> 00:02:12,000
Example okay.

45
00:02:12,000 --> 00:02:16,000
And uh, first of all let me just go ahead and select the kernel okay.

46
00:02:16,000 --> 00:02:17,000
So the kernel is over here.

47
00:02:17,000 --> 00:02:21,000
Now let me go ahead and create a variable of an integer type.

48
00:02:21,000 --> 00:02:26,000
Right now if I really want to create a variable I hope everybody is I have already told it.

49
00:02:26,000 --> 00:02:28,000
Let's say age is equal to 35.

50
00:02:28,000 --> 00:02:34,000
And if I go ahead and write type of age, this will specifically give me an integer value.

51
00:02:34,000 --> 00:02:39,000
As I always said, whatever topics we are seeing again it will be getting repeated.

52
00:02:39,000 --> 00:02:45,000
You know, we will just be seeing that how uh, more things we can actually learn about this right now.

53
00:02:45,000 --> 00:02:47,000
See, I have already spoken about variables.

54
00:02:47,000 --> 00:02:49,000
I have already spoken about integer.

55
00:02:49,000 --> 00:02:53,000
But since we are learning now about data types here also, you'll be able to see that so many different

56
00:02:53,000 --> 00:02:55,000
things are there right then.

57
00:02:55,000 --> 00:03:00,000
um, once I probably create an integer variable, you can also go ahead and create a floating point

58
00:03:00,000 --> 00:03:01,000
number.

59
00:03:01,000 --> 00:03:07,000
So let's say my floating point number uh over here floating point data type okay.

60
00:03:07,000 --> 00:03:11,000
Floating point data type here I'm going to specifically use it.

61
00:03:11,000 --> 00:03:18,000
And let's say over here I define like, uh, you know, um, sentiment or let's say I will, I will

62
00:03:18,000 --> 00:03:23,000
probably define the width right or width or height or anything.

63
00:03:23,000 --> 00:03:24,000
So let's go ahead and define height.

64
00:03:24,000 --> 00:03:27,000
So let's say that if I'm writing 5.11.

65
00:03:27,000 --> 00:03:29,000
So this uh will be nothing.

66
00:03:29,000 --> 00:03:32,000
But if I go ahead and print the height.

67
00:03:32,000 --> 00:03:32,000
Right.

68
00:03:32,000 --> 00:03:37,000
And if I go ahead and print the type of the height, right.

69
00:03:37,000 --> 00:03:41,000
So here you will be able to see that I will be able to get my floating point number right.

70
00:03:41,000 --> 00:03:44,000
So here you can see I'm able to get 5.11.

71
00:03:44,000 --> 00:03:46,000
And this is nothing but class float.

72
00:03:46,000 --> 00:03:50,000
This class was nothing but INT I've already spoken about type casting also.

73
00:03:50,000 --> 00:03:51,000
Right.

74
00:03:51,000 --> 00:03:56,000
So this is one of the other data type like floating data type uh floating data point example.

75
00:03:56,000 --> 00:04:00,000
Um, and the next example that I can probably take is for string.

76
00:04:00,000 --> 00:04:06,000
So string data type example okay I will be showing you more examples as we go ahead.

77
00:04:06,000 --> 00:04:09,000
So let me say this is name is Krish okay.

78
00:04:09,000 --> 00:04:09,000
Okay.

79
00:04:09,000 --> 00:04:16,000
And uh, here you can probably see I'll go ahead and print the name and let me just go ahead and see

80
00:04:16,000 --> 00:04:19,000
print type of name okay.

81
00:04:19,000 --> 00:04:22,000
So here you can actually see that okay fine.

82
00:04:22,000 --> 00:04:25,000
I'm able to see all these things I'm able to get this information and.

83
00:04:25,000 --> 00:04:26,000
All right.

84
00:04:26,000 --> 00:04:31,000
And similarly one more common data type that we will be specifically using is something called as boolean

85
00:04:31,000 --> 00:04:32,000
data type.

86
00:04:32,000 --> 00:04:32,000
Right.

87
00:04:33,000 --> 00:04:37,000
And again guys I'm not showing you much operations because operations will be coming as we go ahead.

88
00:04:37,000 --> 00:04:37,000
Right.

89
00:04:37,000 --> 00:04:40,000
Uh, when will be learning about our next tutorial.

90
00:04:40,000 --> 00:04:43,000
Right where we'll be learning about operators.

91
00:04:43,000 --> 00:04:48,000
At that time, we'll be discussing more about operations, how we can use this and probably, uh, do

92
00:04:48,000 --> 00:04:49,000
different types of operation.

93
00:04:49,000 --> 00:04:49,000
And.

94
00:04:49,000 --> 00:04:50,000
All right.

95
00:04:50,000 --> 00:04:54,000
So for Boolean, uh, what you can do is that I can directly define true or false.

96
00:04:54,000 --> 00:04:56,000
So if I probably use true right.

97
00:04:56,000 --> 00:04:58,000
So this is basically a boolean value.

98
00:04:58,000 --> 00:04:58,000
right.

99
00:04:58,000 --> 00:05:00,000
If I go ahead and see the type right.

100
00:05:00,000 --> 00:05:01,000
So type.

101
00:05:01,000 --> 00:05:03,000
So here you can see it is a bool value.

102
00:05:03,000 --> 00:05:03,000
Right.

103
00:05:03,000 --> 00:05:05,000
So this is one way how you can define it.

104
00:05:05,000 --> 00:05:09,000
Let's say I define saying that is true right.

105
00:05:09,000 --> 00:05:11,000
And I may assign it to true right.

106
00:05:11,000 --> 00:05:19,000
And if I go ahead and see the type of is true type of is underscore true, you'll be able to see, hey,

107
00:05:19,000 --> 00:05:22,000
fine, I'm actually able to get the boolean value right.

108
00:05:22,000 --> 00:05:23,000
This is one way.

109
00:05:23,000 --> 00:05:28,000
The other way is that I may go ahead and directly assign a bool variable.

110
00:05:28,000 --> 00:05:29,000
Right.

111
00:05:29,000 --> 00:05:32,000
And let me just go ahead and execute this okay.

112
00:05:32,000 --> 00:05:37,000
So here you can see uh when we use a boolean variable right.

113
00:05:37,000 --> 00:05:38,000
Or let me do like this.

114
00:05:38,000 --> 00:05:39,000
Right.

115
00:05:39,000 --> 00:05:43,000
So let's say uh I want to go ahead and define a boolean variable.

116
00:05:43,000 --> 00:05:45,000
So I will go ahead and write bool okay.

117
00:05:45,000 --> 00:05:50,000
And if I go ahead and execute it right by default it is probably coming as false right.

118
00:05:50,000 --> 00:05:56,000
Now I can also give some other conditions like let's say uh, I have two variables, right?

119
00:05:57,000 --> 00:05:59,000
Uh, let's say I have two variables.

120
00:05:59,000 --> 00:06:00,000
Let me define it out.

121
00:06:00,000 --> 00:06:03,000
A is equal to ten okay.

122
00:06:03,000 --> 00:06:05,000
And B is equal to ten okay.

123
00:06:05,000 --> 00:06:10,000
Now if I sorry this is getting added I don't know why.

124
00:06:10,000 --> 00:06:13,000
So B is equal to ten okay, so there is some built in functions and all.

125
00:06:13,000 --> 00:06:15,000
I think that is why it is getting applied.

126
00:06:15,000 --> 00:06:18,000
If I write a double equal to B right.

127
00:06:18,000 --> 00:06:20,000
So over here I'm able to get true.

128
00:06:20,000 --> 00:06:20,000
Right.

129
00:06:20,000 --> 00:06:25,000
And even though I see when I'm doing this specific operation, if I go and see the type it is again

130
00:06:25,000 --> 00:06:26,000
Boolean.

131
00:06:26,000 --> 00:06:26,000
Right.

132
00:06:26,000 --> 00:06:29,000
So Boolean is another one data type which we can specifically use.

133
00:06:29,000 --> 00:06:31,000
And this is just for true and false.

134
00:06:31,000 --> 00:06:32,000
Right.

135
00:06:32,000 --> 00:06:34,000
Uh that is why Boolean is specifically used.

136
00:06:34,000 --> 00:06:34,000
Right.

137
00:06:34,000 --> 00:06:37,000
So we will be seeing more of this kind of examples as we go ahead.

138
00:06:37,000 --> 00:06:38,000
Right.

139
00:06:40,000 --> 00:06:45,000
And I know you are excited to see lot of operations, but let's go from basics.

140
00:06:45,000 --> 00:06:48,000
And then we will try to build up more and more concepts.

141
00:06:48,000 --> 00:06:52,000
Right at the end of the day, you really need to try and work hard, right?

142
00:06:52,000 --> 00:06:53,000
And uh, more you work hard.

143
00:06:53,000 --> 00:06:56,000
Uh, it is more like you'll become more perfect in it, right?

144
00:06:56,000 --> 00:07:00,000
So let's see some of the common errors that we may probably face.

145
00:07:00,000 --> 00:07:06,000
You know, some of the common errors that we may get, uh, whenever we are working with, uh, different

146
00:07:06,000 --> 00:07:12,000
different data types, let's say, uh, my result is something called as hello right now for this particular

147
00:07:12,000 --> 00:07:13,000
result.

148
00:07:13,000 --> 00:07:13,000
Right.

149
00:07:13,000 --> 00:07:18,000
And uh, let's say I want to go ahead and add five.

150
00:07:18,000 --> 00:07:18,000
Okay.

151
00:07:18,000 --> 00:07:19,000
Now what will happen.

152
00:07:19,000 --> 00:07:20,000
Let's check okay.

153
00:07:20,000 --> 00:07:27,000
And if I go ahead and execute this here you'll be able to see that I am getting an error, right.

154
00:07:27,000 --> 00:07:31,000
It is saying can only concatenate string right not integer.

155
00:07:31,000 --> 00:07:35,000
And here you can see on the left hand side it is basically a string.

156
00:07:35,000 --> 00:07:40,000
And on the right hand side when I'm performing this specific operation I'm actually giving an integer.

157
00:07:40,000 --> 00:07:46,000
So if I really need to fix this error, all I have to do is that go ahead and write this okay.

158
00:07:46,000 --> 00:07:50,000
And over here I need to do the typecasting.

159
00:07:50,000 --> 00:07:50,000
Right.

160
00:07:50,000 --> 00:07:56,000
So let's say if I go ahead and write str of five, then this issue will definitely get fixed.

161
00:07:56,000 --> 00:07:56,000
Right.

162
00:07:56,000 --> 00:08:00,000
And if I go ahead and print it print the result.

163
00:08:00,000 --> 00:08:01,000
Okay.

164
00:08:01,000 --> 00:08:03,000
So here you'll be able to see I'm able to get hello five.

165
00:08:03,000 --> 00:08:06,000
Now that is the power of typecasting.

166
00:08:06,000 --> 00:08:10,000
See in this particular case when I was trying to concatenate or add five over here.

167
00:08:10,000 --> 00:08:11,000
Right.

168
00:08:11,000 --> 00:08:14,000
And obviously it is not possible because this is a string and this is a numerical value.

169
00:08:14,000 --> 00:08:16,000
We cannot perform any mathematical operation.

170
00:08:16,000 --> 00:08:16,000
Right.

171
00:08:16,000 --> 00:08:20,000
And here you can actually see that I am able to get this.

172
00:08:20,000 --> 00:08:25,000
So these are some of the common errors like minimal common errors that you may be facing.

173
00:08:25,000 --> 00:08:29,000
Uh but we will deep dive more into different different operations.

174
00:08:29,000 --> 00:08:31,000
And one more thing that I really want to talk about.

175
00:08:32,000 --> 00:08:36,000
Uh, let's say if I want to define a string, right, let's say like hello.

176
00:08:36,000 --> 00:08:39,000
Okay, now you'll be able to see string dot.

177
00:08:39,000 --> 00:08:41,000
There are so many different different methods.

178
00:08:41,000 --> 00:08:41,000
Right.

179
00:08:41,000 --> 00:08:45,000
If I probably go ahead and see there are so many different, different methods.

180
00:08:45,000 --> 00:08:52,000
If I go ahead and see over here, see so many different different methods like is is it is uh, is alphanumeric,

181
00:08:52,000 --> 00:08:58,000
is uh, you know, case fold center clear copy count difference difference update.

182
00:08:58,000 --> 00:09:03,000
So we will also be seeing this kind of operations once we go ahead towards the advanced data type.

183
00:09:03,000 --> 00:09:08,000
Because see, we need to understand all these methods because all these methods, once you understand,

184
00:09:08,000 --> 00:09:12,000
you will be able to understand it how you will be using in different different operations.

185
00:09:12,000 --> 00:09:16,000
But right now, since we are just discussing with the basics and we are just in the fourth tutorial,

186
00:09:16,000 --> 00:09:22,000
uh, I want to go a little bit slowly, uh, with definition, with examples show you multiple things

187
00:09:22,000 --> 00:09:28,000
and uh, make sure that you learn things in a way that it it It matters a lot to you, right?

188
00:09:28,000 --> 00:09:33,000
And uh, again, uh, as I said, uh, uh, be patient with respect to this.

189
00:09:33,000 --> 00:09:35,000
I know many people will be excited saying that.

190
00:09:35,000 --> 00:09:37,000
Hey, Chris, you quickly complete fast, right?

191
00:09:38,000 --> 00:09:42,000
But let me go a little bit slowly so that you will be able to understand things.

192
00:09:42,000 --> 00:09:42,000
Okay.

193
00:09:42,000 --> 00:09:45,000
So, uh, yes, uh, this was it from my side.

194
00:09:45,000 --> 00:09:48,000
I hope you like this particular video.

195
00:09:48,000 --> 00:09:49,000
Um, yes.

196
00:09:49,000 --> 00:09:51,000
I will see you all in the next video.

197
00:09:51,000 --> 00:09:52,000
Thank you.

