1 00:00:00,570 --> 00:00:01,470 -: Welcome back. 2 00:00:01,470 --> 00:00:06,470 Remember in Python that string is written as str 3 00:00:07,800 --> 00:00:10,230 and this is a special word? 4 00:00:10,230 --> 00:00:12,570 Actually, it's a built-in, what we call, "function," 5 00:00:12,570 --> 00:00:14,880 or a built in action that we can take. 6 00:00:14,880 --> 00:00:16,800 Now let me ask you this: 7 00:00:16,800 --> 00:00:20,493 What happens if I do string 100? 8 00:00:21,420 --> 00:00:25,293 100 is clearly a number, an integer. 9 00:00:26,160 --> 00:00:29,673 But what if we run the string function on this? 10 00:00:30,540 --> 00:00:31,373 Let's find out. 11 00:00:31,373 --> 00:00:36,373 Let's do print here and then run this. 12 00:00:36,810 --> 00:00:41,810 If I click run, I get a hundred. 13 00:00:41,880 --> 00:00:43,500 All right. 14 00:00:43,500 --> 00:00:48,137 But, hmm, is this an int or a string? 15 00:00:50,490 --> 00:00:55,110 To find that out, once again, let's wrap this 16 00:00:55,110 --> 00:00:59,193 so the answer of whatever this value is into type, 17 00:01:00,870 --> 00:01:01,703 like so. 18 00:01:04,920 --> 00:01:08,640 I know this is a lot of brackets, but remember, 19 00:01:08,640 --> 00:01:11,070 we're evaluating this piece of code. 20 00:01:11,070 --> 00:01:13,290 So we're turning 100 into a string, 21 00:01:13,290 --> 00:01:15,030 or running the string action, 22 00:01:15,030 --> 00:01:18,240 and then we're gonna check the type of this entire thing, 23 00:01:18,240 --> 00:01:19,920 and then we're going to print it out. 24 00:01:19,920 --> 00:01:24,920 If I click run, I see that it's a string type. 25 00:01:25,080 --> 00:01:29,730 So we've converted 100 into string using this. 26 00:01:29,730 --> 00:01:32,610 Now, just to confuse you a little bit more, 27 00:01:32,610 --> 00:01:37,610 what if we do something like int, like this? 28 00:01:40,380 --> 00:01:42,780 All right, even more brackets. What happens now? 29 00:01:42,780 --> 00:01:43,613 Can you guess? 30 00:01:45,630 --> 00:01:48,750 Well, we convert a hundred into a string, 31 00:01:48,750 --> 00:01:52,020 then convert it back into an integer 32 00:01:52,020 --> 00:01:53,370 and then we check the type of it, 33 00:01:53,370 --> 00:01:56,340 which is a class int, and then we print that. 34 00:01:56,340 --> 00:01:58,784 So remember, this was the same as me saying 35 00:01:58,784 --> 00:02:02,940 A equals str 100. 36 00:02:02,940 --> 00:02:07,940 And then B is going to equal int of A, 37 00:02:11,070 --> 00:02:13,830 because we're evaluating this part. 38 00:02:13,830 --> 00:02:18,270 And then I'm saying C is going to equal the type 39 00:02:18,270 --> 00:02:20,763 of whatever B is. 40 00:02:21,600 --> 00:02:23,823 And then finally we're printing C. 41 00:02:24,870 --> 00:02:28,353 So that piece of code was the same as doing this. 42 00:02:30,090 --> 00:02:31,830 Very, very cool. 43 00:02:31,830 --> 00:02:35,823 Now this is the idea of type conversion. 44 00:02:36,900 --> 00:02:39,106 Again, if I were to write that down, 45 00:02:39,106 --> 00:02:41,640 it's called type conversion. 46 00:02:41,640 --> 00:02:45,720 We're converting the type of our data types 47 00:02:45,720 --> 00:02:48,330 and you can do that throughout programming. 48 00:02:48,330 --> 00:02:52,110 And we'll talk a lot about this throughout the course. 49 00:02:52,110 --> 00:02:53,940 But it's the main reason we have things 50 00:02:53,940 --> 00:02:57,720 like str, int, we have things like float 51 00:02:57,720 --> 00:03:00,810 and many other data types that we're gonna talk about. 52 00:03:00,810 --> 00:03:02,490 I'll see you in the next video. 53 00:03:02,490 --> 00:03:03,323 Bye-bye.