1 00:00:00,390 --> 00:00:06,220 Welcome back to our class of our course about the complete introduction to that science with Python. 2 00:00:06,660 --> 00:00:12,180 So basically this class, we are going to talk about plenty of very interesting formulas that you guys 3 00:00:12,180 --> 00:00:16,620 will see are really, really interesting and simple to use. 4 00:00:17,820 --> 00:00:22,530 So basically, the four well, the five operations that we are going to learn to do today are pretty 5 00:00:22,530 --> 00:00:22,810 simple. 6 00:00:22,830 --> 00:00:25,840 The first one would allow us to create an area. 7 00:00:26,100 --> 00:00:32,010 So it's going to be the Lenn space operation that will allow us to create Arrowood with numbers that 8 00:00:32,010 --> 00:00:33,450 will be automatically generated. 9 00:00:34,440 --> 00:00:35,640 The same one will be slicing. 10 00:00:35,670 --> 00:00:42,300 So basically, we are going to slice our area into what we will be able to slice our area, for example, 11 00:00:42,420 --> 00:00:49,830 with multiple areas, with multiple lines into an area, with just one line with the numbers that we 12 00:00:49,830 --> 00:00:50,100 want. 13 00:00:50,430 --> 00:00:55,680 And finally, we're going to talk about the min max and some functions which are also really simple 14 00:00:55,680 --> 00:00:58,140 to use and can be really effective. 15 00:00:58,530 --> 00:00:59,350 So let's start. 16 00:01:00,240 --> 00:01:05,160 So I said the first function that we are going to talk about, the little space function, basically 17 00:01:05,160 --> 00:01:07,120 how this function works is pretty simple. 18 00:01:07,320 --> 00:01:08,150 So the first thing. 19 00:01:08,460 --> 00:01:09,810 So why is it used? 20 00:01:09,810 --> 00:01:18,810 At first it's used to create a ARRY with numbers that are from an equal distance from one another. 21 00:01:19,080 --> 00:01:21,420 So how exactly this works so pretty simple. 22 00:01:21,420 --> 00:01:24,010 We want to generate or we want to create a variable. 23 00:01:24,030 --> 00:01:33,870 So the one in this case equal, so empty like always that in this case the function would be in space. 24 00:01:35,820 --> 00:01:36,530 From this moment. 25 00:01:36,540 --> 00:01:41,950 We want the first number that we going to enter here because we have three elements inside of this variable. 26 00:01:42,240 --> 00:01:44,400 The first one would be the first number. 27 00:01:44,410 --> 00:01:52,190 So let's say we want to have 10 as our first number, then that's our start number. 28 00:01:52,500 --> 00:01:54,690 So our saying no would be, let's say, 50. 29 00:01:54,960 --> 00:02:02,130 So basically what we are asking right now, Python to do is starting with the number 10 and finishing 30 00:02:02,130 --> 00:02:03,260 at the number 50. 31 00:02:03,720 --> 00:02:09,180 And we want Python to generate how many random numbers at equal distance, how many numbers of equal 32 00:02:09,180 --> 00:02:15,330 distance, let's say one python to generate one hundred numbers at equal distance between 10 and 50. 33 00:02:15,780 --> 00:02:17,520 Let's start with less than one hundred. 34 00:02:17,520 --> 00:02:20,580 Let's say we want to generate only two numbers. 35 00:02:21,180 --> 00:02:26,810 So what we will see right here, just printing that function print. 36 00:02:29,400 --> 00:02:30,320 He was. 37 00:02:31,880 --> 00:02:37,670 So we will see is that Python judgment written and if we ask Python to generate four numbers. 38 00:02:39,410 --> 00:02:44,780 So in this case, it will generate 10 as first number, then twenty three to three feet, then 36, 39 00:02:44,780 --> 00:02:45,280 then 50. 40 00:02:45,710 --> 00:02:48,620 So those numbers are at equal distance. 41 00:02:49,220 --> 00:02:52,930 So basically they're at equal distance from ten to twenty three. 42 00:02:53,270 --> 00:02:55,430 The trajectory is at equal distance. 43 00:02:55,430 --> 00:02:59,390 That twenty three from thirty six, that's sixty six from fifty. 44 00:02:59,780 --> 00:03:00,830 Those can see it's pretty simple. 45 00:03:00,830 --> 00:03:02,690 We can do this with really huge numbers. 46 00:03:02,690 --> 00:03:06,130 For example, one hundred is just going to take more time to complete. 47 00:03:06,140 --> 00:03:12,860 But as you can see, you can have really huge numbers and it's going to automatically calculate everything. 48 00:03:14,240 --> 00:03:19,460 So as you can see, this function could be really, really interesting for bigger projects and for the 49 00:03:19,460 --> 00:03:23,060 same function that we are going to talk about would be the slicing function. 50 00:03:23,330 --> 00:03:27,450 And for this function, we would we would need to create ourselves an area. 51 00:03:27,800 --> 00:03:32,330 So like always, we will create ourselves and airy and pretty simple. 52 00:03:32,330 --> 00:03:34,370 So we want to start that with a variable. 53 00:03:34,400 --> 00:03:39,010 So once again, we will have are one and that area. 54 00:03:40,280 --> 00:03:46,040 And from this moment, we'll create an area that will be two two dimensional because this function works 55 00:03:46,040 --> 00:03:47,200 with two dimensional areas. 56 00:03:47,750 --> 00:03:48,710 So pretty simple. 57 00:03:48,710 --> 00:03:52,050 We will have our even then numbers as always. 58 00:03:52,070 --> 00:04:01,710 So two, four and six and four decision area we will have in this case one, three and five. 59 00:04:02,450 --> 00:04:04,550 So you can see it's pretty simple. 60 00:04:06,050 --> 00:04:07,970 So we have one, three and five. 61 00:04:08,960 --> 00:04:10,400 So we have our area right here. 62 00:04:10,430 --> 00:04:12,110 So just to try out will print it. 63 00:04:12,380 --> 00:04:16,580 Print we are one. 64 00:04:17,450 --> 00:04:18,060 Here we go. 65 00:04:18,080 --> 00:04:21,220 So if we run it, as you can see, it works. 66 00:04:21,230 --> 00:04:22,530 So everything is fine. 67 00:04:23,210 --> 00:04:28,260 So what I want to do right now is work with so we want to slice our function. 68 00:04:29,030 --> 00:04:31,200 So basically, how exactly will slice our function? 69 00:04:31,220 --> 00:04:32,150 It's pretty simple. 70 00:04:32,900 --> 00:04:35,700 So let's say we only want the number four. 71 00:04:35,870 --> 00:04:37,530 So how exactly we'll do this? 72 00:04:37,550 --> 00:04:38,510 It's pretty simple. 73 00:04:39,090 --> 00:04:45,860 We'll write down print and what exactly what we want. 74 00:04:46,110 --> 00:04:48,410 We want to print from variable one. 75 00:04:54,970 --> 00:05:01,010 So from variable one, we want to print inside of the line zero. 76 00:05:01,120 --> 00:05:04,830 So this line, the line zero, we want the first argument. 77 00:05:04,840 --> 00:05:08,260 So basically in Python, we start counting from zero. 78 00:05:08,290 --> 00:05:09,350 So this would be zero. 79 00:05:09,370 --> 00:05:10,030 This would be one. 80 00:05:10,030 --> 00:05:10,720 This would be two. 81 00:05:11,110 --> 00:05:14,430 So from the line zero, this would be our line zero. 82 00:05:15,010 --> 00:05:19,090 We want to print the element number one or number two. 83 00:05:19,120 --> 00:05:21,490 So basically how we'll write it down right here. 84 00:05:21,790 --> 00:05:29,310 So from the line zero, we want to print the element number two. 85 00:05:29,320 --> 00:05:29,950 So No. 86 00:05:29,950 --> 00:05:32,580 One in this case, because in Python language is going to be one. 87 00:05:33,820 --> 00:05:36,280 And if we run it, we will have four. 88 00:05:36,310 --> 00:05:38,770 So as you can see, it's pretty simple to understand. 89 00:05:39,130 --> 00:05:44,410 Now, let's say, for example, we want to print the number four and the number three right here. 90 00:05:44,440 --> 00:05:46,390 So basically for the two areas. 91 00:05:46,930 --> 00:05:48,310 So how exactly do we write it down? 92 00:05:48,340 --> 00:05:49,210 It's pretty simple. 93 00:05:49,630 --> 00:05:51,250 We will use the two points. 94 00:05:51,610 --> 00:05:53,920 So what does those two points mean? 95 00:05:54,220 --> 00:06:00,340 So from the line zero until the infinity of all lines. 96 00:06:00,350 --> 00:06:04,460 So basically until the end, I want to print all the number ones. 97 00:06:04,840 --> 00:06:12,700 So if I translate basically from the line zero from here to the end, if I hear I only have two lines 98 00:06:12,760 --> 00:06:17,260 basically from here till the end, I want to print out number one. 99 00:06:17,290 --> 00:06:20,090 So basically it's going to print the four and the three right here. 100 00:06:21,160 --> 00:06:25,300 So if I run, the app will do it will print for entry as well. 101 00:06:26,200 --> 00:06:29,920 So for the purpose of this example, will add more areas. 102 00:06:29,950 --> 00:06:35,700 So just to try it out inside of those areas will just write down some random numbers. 103 00:06:35,740 --> 00:06:37,030 For example, seven. 104 00:06:37,990 --> 00:06:38,830 Twenty four. 105 00:06:40,480 --> 00:06:41,320 Twenty one. 106 00:06:42,850 --> 00:06:43,390 Then. 107 00:06:45,170 --> 00:06:46,580 30 and 50. 108 00:06:48,230 --> 00:06:48,620 All right. 109 00:06:49,040 --> 00:06:51,680 And if we want our app, it's going to do the exact same thing. 110 00:06:51,860 --> 00:06:56,330 As I said, it's going to print all the number ones in all the areas. 111 00:06:56,840 --> 00:06:57,170 All right. 112 00:06:57,180 --> 00:06:58,610 So you guys get the point. 113 00:06:58,820 --> 00:07:04,070 Now, let's say we want to print from here from the from this line right here. 114 00:07:04,100 --> 00:07:04,780 So pretty simple. 115 00:07:05,060 --> 00:07:11,990 Instead of writing zero right here, what we'll do is we'll ask Python to print from line number, let's 116 00:07:11,990 --> 00:07:12,900 say one. 117 00:07:12,920 --> 00:07:18,840 So from this line right here until the end, we want to print out number one. 118 00:07:18,860 --> 00:07:22,110 So from line number one, want to print all, number one. 119 00:07:22,130 --> 00:07:24,380 So it's going to print the three to twenty four and the 30. 120 00:07:24,560 --> 00:07:30,230 So if we run the app, as I said, it printed the three, the twenty four and the third. 121 00:07:31,010 --> 00:07:32,660 So this is the slicing part. 122 00:07:32,670 --> 00:07:37,260 So you guys get the point and you understand why exactly do we use slicing. 123 00:07:37,910 --> 00:07:38,230 All right. 124 00:07:38,240 --> 00:07:40,970 So next few functions that we are going to talk about. 125 00:07:40,970 --> 00:07:44,820 You'll see they're pretty simple to use and they are work the exact same way. 126 00:07:44,990 --> 00:07:49,340 So those are the men, the max and the sum function as well. 127 00:07:49,730 --> 00:07:55,510 So, as always, what we need right now, we need are so basically we'll just create a variable. 128 00:07:55,520 --> 00:08:00,540 So in this case, the one that will be equal to our area. 129 00:08:00,560 --> 00:08:10,400 So like always in that area, you open up the parenthesis and in this case, like always going to be 130 00:08:10,400 --> 00:08:12,290 two, four, six. 131 00:08:12,760 --> 00:08:13,060 All right. 132 00:08:13,070 --> 00:08:15,110 So we get our area right here. 133 00:08:15,410 --> 00:08:19,640 Next thing that we want to do is just finding out the max of all this. 134 00:08:21,220 --> 00:08:22,810 So basically print. 135 00:08:25,740 --> 00:08:34,040 The first thing we write down are are a variable name, so in this variable, so in our one, we want 136 00:08:34,040 --> 00:08:41,590 to print the max so that Max open and close parenthesis really important and run the app. 137 00:08:41,600 --> 00:08:43,930 And as you can see, it will print us six. 138 00:08:44,270 --> 00:08:45,930 So we have our six right here. 139 00:08:45,950 --> 00:08:47,990 So this is the max of this area. 140 00:08:48,770 --> 00:08:54,980 What's cool about it is that it works for all types of well for one dimension as well as two dimensional 141 00:08:54,980 --> 00:08:55,400 arrays. 142 00:08:56,000 --> 00:09:01,670 So if we add a second dimension to this area, so two we have two, four, six. 143 00:09:02,690 --> 00:09:07,850 And let's say we add one, three and five. 144 00:09:09,660 --> 00:09:15,780 Like we always do and we were on the up, as you can see, it's going to stay six, but here we have 145 00:09:15,780 --> 00:09:16,710 50, for example. 146 00:09:17,400 --> 00:09:18,780 You'll see it's going to become 50. 147 00:09:18,990 --> 00:09:22,000 So basically it's going to work with the whole area right here. 148 00:09:22,500 --> 00:09:22,820 All right. 149 00:09:22,830 --> 00:09:24,150 So same thing for the men. 150 00:09:24,150 --> 00:09:30,060 If one of the men of all this pretty simple instead of Max just right down the middle and you guys can 151 00:09:30,060 --> 00:09:32,130 run the up and it's going to be one. 152 00:09:32,140 --> 00:09:34,260 So the men, the smallest number is one. 153 00:09:34,260 --> 00:09:37,710 And if we change one bit, then the smallest number will become two. 154 00:09:37,710 --> 00:09:39,260 So in this case, it's going to be two. 155 00:09:39,990 --> 00:09:40,330 All right. 156 00:09:40,470 --> 00:09:42,700 And finally, the last thing is this. 157 00:09:42,960 --> 00:09:48,960 So basically what the sum function where the sum operation will do inside of this area will simply calculate 158 00:09:48,960 --> 00:09:51,840 the sum of all the numbers inside of this. 159 00:09:52,170 --> 00:09:52,920 So very simple. 160 00:09:52,920 --> 00:09:55,230 Just write down some very important print. 161 00:09:55,940 --> 00:10:03,300 So the name of our of our Bible, Dutson, you run the app and as you can see it, give us twenty one. 162 00:10:03,330 --> 00:10:05,700 So basically is the sum of all the numbers right here. 163 00:10:06,900 --> 00:10:12,930 So as you can see, it's pretty simple to understand those are some other really simple functions that 164 00:10:12,930 --> 00:10:15,000 works with errors and numbers. 165 00:10:15,030 --> 00:10:17,780 So those are really simple of applications. 166 00:10:18,300 --> 00:10:23,010 So I hope you guys learned some few things inside of this class. 167 00:10:23,160 --> 00:10:27,640 And in the next class, we are still going to learn some other numbers by operations. 168 00:10:27,690 --> 00:10:30,990 So that's it for this class, guys, and see all in our next class.