1 00:00:00,000 --> 00:00:03,300 All right. Let's take a look at some basic arithmetic. 2 00:00:03,370 --> 00:00:08,780 Now, when I say basic arithmetic, all I mean here is math, 3 00:00:08,960 --> 00:00:10,850 and I don't mean advanced math. 4 00:00:10,860 --> 00:00:13,420 It's not algebra, it's not calculus, 5 00:00:13,430 --> 00:00:15,280 it's nothing complicated. 6 00:00:15,290 --> 00:00:21,750 But we do need to know how we can add subtract, divide, multiply, 7 00:00:21,750 --> 00:00:25,800 and we'll probably even use exponents, oops, and give you a 8 00:00:25,800 --> 00:00:27,900 sneak peek there, exponents. 9 00:00:28,100 --> 00:00:31,700 So in Python, and in most programming languages, 10 00:00:31,700 --> 00:00:33,299 these rules hold true. 11 00:00:33,330 --> 00:00:35,720 So when you're trying to add a number you can add, let's 12 00:00:35,730 --> 00:00:38,250 say 89 + 11. 13 00:00:38,250 --> 00:00:41,900 And that's just simply going to add the number. That will give us 100. 14 00:00:41,900 --> 00:00:44,930 And likewise, if we wanted to subtract a number, it's the 15 00:00:44,930 --> 00:00:50,900 subtract symbol, so 100 - 49 is equal to 51. 16 00:00:50,980 --> 00:00:54,620 Dividing is as simple as 100, 17 00:00:54,630 --> 00:00:58,430 and then you use a '/', divided by, let's divide that by 18 00:00:58,430 --> 00:01:02,000 10. That will give us 10. 19 00:01:02,000 --> 00:01:06,099 And if we want to multiply, we could do 9 times 9, 20 00:01:06,180 --> 00:01:08,670 and to multiply it's just an '*'. 21 00:01:08,670 --> 00:01:10,900 So it's the little '*' symbol. 22 00:01:10,980 --> 00:01:12,510 And that's how we multiply. 23 00:01:12,520 --> 00:01:15,540 And exponents are one we're going to be using throughout 24 00:01:15,550 --> 00:01:17,250 to this course quite frequently. 25 00:01:17,250 --> 00:01:22,440 And in exponents in some programming languages is like three 26 00:01:22,600 --> 00:01:24,200 to the power of three, 3^3, 27 00:01:25,200 --> 00:01:28,800 but in Python we use two asterisks side by side, '**' 28 00:01:28,850 --> 00:01:32,420 So three to the power of three, 3**3 is going to give us 27, 3 29 00:01:32,430 --> 00:01:36,050 times 3 times 3; 3 times 3 times 3 is what that is. 30 00:01:36,300 --> 00:01:38,400 And that is how we do an exponent. 31 00:01:38,410 --> 00:01:41,250 Now, there's one other thing that we're going to look at 32 00:01:41,260 --> 00:01:45,000 a little bit down the road, and it's called modulus, modulus. 33 00:01:45,240 --> 00:01:48,510 And you know, when you divide a number, and you get a remainder, 34 00:01:48,520 --> 00:01:49,860 that's what a modulus is. 35 00:01:50,100 --> 00:01:56,300 So if you divide 10 by 3, you're going to get 3 with 36 00:01:56,310 --> 00:01:57,410 some remainder. 37 00:01:57,420 --> 00:01:58,940 So 3.333. 38 00:01:59,000 --> 00:02:01,760 Now what if you wanted to get that remainder as a number? 39 00:02:02,000 --> 00:02:07,000 So 3 goes into 10, 3 times 3-6-9, and there's a remainder of 1. 40 00:02:07,020 --> 00:02:09,900 We can do that with the percent(%) symbol. 41 00:02:09,910 --> 00:02:13,710 So we take one number and we divide it by, not divided by, 42 00:02:13,710 --> 00:02:18,700 we modulus it by a second number, and we hit enter, and we get 1. 43 00:02:18,700 --> 00:02:24,400 So what that means is 3 goes into 10, 3 times 3-6-9, 44 00:02:24,410 --> 00:02:27,760 and then 10 minus 9 is going to be 1, and that's your 45 00:02:27,770 --> 00:02:30,900 remainder. Beyond that, we're actually not going to be doing 46 00:02:30,910 --> 00:02:32,790 too much arithmetic in this course. 47 00:02:32,800 --> 00:02:36,000 And believe it or not, there's actually not a lot of mathematics 48 00:02:36,010 --> 00:02:37,800 in most programming these days. 49 00:02:38,160 --> 00:02:39,300 There is mathematics 50 00:02:39,310 --> 00:02:43,290 if you get into data science, or if you want to get into, even 51 00:02:43,300 --> 00:02:45,480 some forms of machine learning has some math, 52 00:02:45,490 --> 00:02:48,500 but for the most part programming does not have a lot of 53 00:02:48,510 --> 00:02:53,450 math, and so by no means do you need to be a mathematician 54 00:02:53,460 --> 00:02:55,760 in order to learn how to program. 55 00:02:56,000 --> 00:02:58,460 People always think that, "Oh, because you're a programmer, 56 00:02:58,470 --> 00:02:59,450 you must be good at math". 57 00:02:59,460 --> 00:03:01,620 But that simply does not have to be true. 58 00:03:01,630 --> 00:03:03,660 So that is basic arithmetic. 59 00:03:03,660 --> 00:03:09,200 We add with a '+' symbol, we subtract with the '-' or the minus symbol, 60 00:03:09,200 --> 00:03:12,600 we divide with a '/', 61 00:03:12,600 --> 00:03:15,400 we multiply with an asterisk or the star, '*', 62 00:03:15,400 --> 00:03:17,800 we exponent with two stars, '**', 63 00:03:17,880 --> 00:03:21,140 and this is just multiplying three numbers together, and 64 00:03:21,140 --> 00:03:25,100 we modulus or get the remainder with a percent (%) symbol.