1 00:00:00,470 --> 00:00:01,430 Welcome back. 2 00:00:01,550 --> 00:00:04,880 Let's continue our understanding of ant and float. 3 00:00:05,590 --> 00:00:12,310 We talked about the idea of these two data types and how we can use operations on them that we're familiar 4 00:00:12,310 --> 00:00:18,490 with from math class, plus a few ones that maybe we haven't seen before, such as modulo or the double 5 00:00:18,490 --> 00:00:22,390 slash or the double multiply for the power of. 6 00:00:23,210 --> 00:00:27,950 Now this is really cool because we can get our computers to do well. 7 00:00:27,950 --> 00:00:30,590 Math for us like a calculator, right? 8 00:00:31,270 --> 00:00:36,700 But a programming language also provides for us different actions that we can perform. 9 00:00:37,180 --> 00:00:44,100 Now, besides these ones, we also learn that there's a type of action that we can take. 10 00:00:44,110 --> 00:00:51,370 There's a print action that we can take, but there's also specific math type functions that ant and 11 00:00:51,370 --> 00:00:54,760 float are able to use that are built into Python. 12 00:00:56,490 --> 00:01:01,890 Now these are called wall math functions and functions. 13 00:01:01,890 --> 00:01:06,960 Something we'll talk about later on are these actions that we've been talking about. 14 00:01:07,760 --> 00:01:09,380 Remember our diagram here. 15 00:01:09,650 --> 00:01:14,690 We're starting to learn about the data types and the actions that we can perform on them. 16 00:01:14,990 --> 00:01:21,680 Now, in most programming languages, these actions are called functions and we have a whole section 17 00:01:21,680 --> 00:01:22,160 on them. 18 00:01:22,160 --> 00:01:26,390 But for now there are some functions that we can use. 19 00:01:26,720 --> 00:01:34,370 So this is a print function, this is a type function, but there's specific math functions such as 20 00:01:34,440 --> 00:01:35,240 brute. 21 00:01:36,450 --> 00:01:44,610 And you see right away when I type Ripple is a tool like an ID that hints and tells us what we can add. 22 00:01:45,340 --> 00:01:48,040 So says round and give me a number. 23 00:01:48,740 --> 00:01:53,160 And maybe a digit, but let's just worry about the first one for now. 24 00:01:53,180 --> 00:01:57,710 So around if I do 3.1 and I round here. 25 00:01:59,080 --> 00:01:59,770 I get. 26 00:02:00,610 --> 00:02:01,300 Two. 27 00:02:01,390 --> 00:02:01,700 Hmm. 28 00:02:01,780 --> 00:02:03,340 Well, that's not right. 29 00:02:03,370 --> 00:02:03,850 Right. 30 00:02:03,880 --> 00:02:10,900 That's actually the result from up here, because we need to also tell it to perform with a function 31 00:02:10,900 --> 00:02:12,040 of print. 32 00:02:12,580 --> 00:02:14,920 Hey, print to the screen. 33 00:02:14,920 --> 00:02:16,740 Whatever the result of this is. 34 00:02:16,750 --> 00:02:21,190 And just to make things easier to see, I'm going to comment this out. 35 00:02:21,190 --> 00:02:26,920 So I'm just selecting everything and then pressing command slash or if you're on Windows Control slash 36 00:02:27,340 --> 00:02:28,360 if I click Run. 37 00:02:30,070 --> 00:02:34,060 I get three because I'm rounding down the number. 38 00:02:34,770 --> 00:02:38,490 So let's say if it was 3.9, I click. 39 00:02:39,490 --> 00:02:40,930 And I get four again. 40 00:02:40,930 --> 00:02:42,520 I'm rounding the number. 41 00:02:43,830 --> 00:02:51,270 Another math function that's built into Python is something called a, B, s, and you see right away 42 00:02:51,270 --> 00:02:58,590 that I get abs here and ABS returns the absolute value of the argument. 43 00:02:59,320 --> 00:03:04,690 And again, for those that aren't too familiar with math, an absolute value simply means, well, no 44 00:03:04,690 --> 00:03:05,590 negative numbers. 45 00:03:05,590 --> 00:03:09,940 So an absolute value of -20 is 20. 46 00:03:10,510 --> 00:03:15,490 And now because we know about math functions, I can start Googling, right? 47 00:03:15,490 --> 00:03:19,810 I can say, hey, I'm a python programmer and I want to learn about math functions. 48 00:03:19,810 --> 00:03:25,720 Well, I can go Python three math functions. 49 00:03:26,430 --> 00:03:28,710 And look at that right away. 50 00:03:28,740 --> 00:03:33,300 Google tells me that there's a ton that we can use. 51 00:03:33,450 --> 00:03:35,600 You don't have to memorize all of these. 52 00:03:35,610 --> 00:03:39,780 As a matter of fact, some of these I've never, ever used in my programming career. 53 00:03:40,050 --> 00:03:44,460 But it's good to know that they have these tools available to you. 54 00:03:44,460 --> 00:03:48,240 And as a programmer, this is something that you'll have to get used to. 55 00:03:48,240 --> 00:03:55,770 The idea that you won't actually memorize every single action that we can take for each data type, 56 00:03:56,160 --> 00:04:02,130 because some of these are very rarely used, some of them you'll never use in your career. 57 00:04:02,160 --> 00:04:05,580 The key is to understand how to Google them and how to find them. 58 00:04:05,700 --> 00:04:10,740 And throughout this course, I will show you the important ones that you're going to see over and over 59 00:04:10,920 --> 00:04:11,490 and over. 60 00:04:12,290 --> 00:04:18,470 But as a way for you to develop as a programmer, at least you know that this is how you look for answers 61 00:04:18,470 --> 00:04:23,810 and find out that, hey, there's different math functions that we can use with numbers. 62 00:04:24,920 --> 00:04:25,370 All right. 63 00:04:25,370 --> 00:04:27,680 Let's take a break and continue in the next video. 64 00:04:28,220 --> 00:04:28,790 Bye bye.