Would you like to inspect the original subtitles? These are the user uploaded subtitles that are being translated:
1
00:00:00,620 --> 00:00:01,500
Welcome back.
2
00:00:01,520 --> 00:00:10,280
Remember in Python that string is written as SDR and this is a special word.
3
00:00:10,310 --> 00:00:14,930
Actually it's a built in what we call a function or a built in action that we can take.
4
00:00:14,960 --> 00:00:26,450
Now let me ask you this what happens if I do string 100 one hundred is clearly a number an integer but
5
00:00:26,780 --> 00:00:36,860
what if we run the string function on this let's find out let's do print here and then run this.
6
00:00:36,860 --> 00:00:41,870
If I click Run I get a hundred.
7
00:00:41,930 --> 00:00:43,230
All right.
8
00:00:43,310 --> 00:00:51,800
But is this an int or a string to find that out.
9
00:00:51,860 --> 00:00:54,970
Once again let's wrap this.
10
00:00:55,190 --> 00:01:04,760
So the answer of whatever this value is into type.
11
00:01:05,000 --> 00:01:10,760
I know this is a lot of brackets but remember we're evaluating this piece of code.
12
00:01:11,120 --> 00:01:16,820
So we're turning 100 into a string or running the string action and then we're going to check the type
13
00:01:16,940 --> 00:01:19,850
of this entire thing and then we're going to print it out.
14
00:01:20,000 --> 00:01:25,130
If I click Run I see that it's a String type.
15
00:01:25,130 --> 00:01:29,580
So we've converted one hundred into string using this.
16
00:01:29,780 --> 00:01:34,430
Now just to confuse you a little bit more what if we do something like
17
00:01:38,630 --> 00:01:40,800
like this all right.
18
00:01:40,830 --> 00:01:41,850
Even more brackets.
19
00:01:41,850 --> 00:01:42,800
What happens now.
20
00:01:42,840 --> 00:01:52,390
Can you guess while we convert a hundred into a string then convert it back into an integer and then
21
00:01:52,390 --> 00:01:54,660
we check the type of it which is a class INT.
22
00:01:54,670 --> 00:01:55,630
And then we print that.
23
00:01:56,380 --> 00:02:07,420
So remember this was the same as me saying A equals SDR one hundred and then B is going to equal int
24
00:02:09,570 --> 00:02:19,230
of A because we're evaluating this part and then I'm saying C is going to equal the type of whatever
25
00:02:19,800 --> 00:02:21,580
B is.
26
00:02:21,670 --> 00:02:31,890
And then finally we're printing C so that piece of code was the same as doing this very very cool.
27
00:02:31,890 --> 00:02:37,300
Now this is the idea of type conversion again.
28
00:02:37,310 --> 00:02:41,630
If I were to write that down it's called type conversion.
29
00:02:41,690 --> 00:02:49,100
We're converting the type of our data types and you can do that throughout programming and we'll talk
30
00:02:49,490 --> 00:02:52,130
a lot about this throughout the course.
31
00:02:52,130 --> 00:02:59,210
But it's the main reason we have things like SDR int we have things like float and many other data types
32
00:02:59,210 --> 00:03:00,700
that we're going to talk about.
33
00:03:00,920 --> 00:03:02,800
I'll see in the next video by.
3162
Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.