1 00:00:05,760 --> 00:00:11,340 How do all of the ninjas that are following these lectures after covering the previous lecture where 2 00:00:11,340 --> 00:00:19,920 we went over the segments, now it's time to show the answers for the assignments, which, as I said, 3 00:00:20,130 --> 00:00:21,230 are a bit challenging. 4 00:00:21,450 --> 00:00:26,680 And as you might experience, as they have a combination of a lot of topic, lots of topics mixed together. 5 00:00:26,700 --> 00:00:27,010 All right. 6 00:00:27,480 --> 00:00:36,390 So as soon as you open the project, as always, create a new file, you can call it for loops practice. 7 00:00:39,110 --> 00:00:42,680 All right, and also here for Loop. 8 00:00:44,590 --> 00:00:51,340 Practice and before beginning and just going to copy here all of the rules that we had. 9 00:00:51,860 --> 00:00:52,440 All right. 10 00:00:53,890 --> 00:00:54,490 Like this. 11 00:00:55,280 --> 00:00:55,700 All right. 12 00:00:56,020 --> 00:00:59,080 And as you can see here, it's all marked in green. 13 00:00:59,650 --> 00:01:02,050 It's the same as doing like this. 14 00:01:02,350 --> 00:01:02,560 All right. 15 00:01:02,590 --> 00:01:04,240 So this code will be ignored. 16 00:01:04,240 --> 00:01:09,910 And the reason it's in green, because I put these three quotation marks at the beginning and at the 17 00:01:09,910 --> 00:01:14,290 end and everything that I write in between is a comment. 18 00:01:14,440 --> 00:01:14,880 All right. 19 00:01:15,940 --> 00:01:20,830 So these are the demands of the assignment and this is the list that we need to address to. 20 00:01:20,980 --> 00:01:26,140 And I'm just going to copy it as the beginning, because it's the same list. 21 00:01:26,300 --> 00:01:28,030 No thinking is applied here. 22 00:01:28,420 --> 00:01:32,590 So create a list of businesses. 23 00:01:34,520 --> 00:01:40,700 All right, so right here we have the list of businesses that we need to apply the rules about and let's 24 00:01:40,700 --> 00:01:41,120 begin. 25 00:01:41,510 --> 00:01:41,990 All right. 26 00:01:42,620 --> 00:01:52,610 So first of all, let us create a loop and the loop will be full loop and we shall have an in part in 27 00:01:52,610 --> 00:01:54,110 businesses business. 28 00:01:55,280 --> 00:01:57,290 We need to put business. 29 00:02:02,540 --> 00:02:07,270 And as you can see, we have an error here because we need to pull something off the floor and I'll 30 00:02:07,280 --> 00:02:10,730 call it single income like this. 31 00:02:11,270 --> 00:02:11,770 All right. 32 00:02:12,230 --> 00:02:15,290 So we have the whole list right here. 33 00:02:15,530 --> 00:02:22,010 And we have the single income, which is one sale out of these these guys right here and inside the 34 00:02:22,010 --> 00:02:22,370 follow. 35 00:02:22,460 --> 00:02:24,080 We're going to do the following thing. 36 00:02:24,890 --> 00:02:31,340 We're going to, first of all, break down all of these four sections right here because we want to 37 00:02:31,340 --> 00:02:38,930 have some statements which will limit the taxes according to these incomes. 38 00:02:38,930 --> 00:02:39,260 Right. 39 00:02:39,440 --> 00:02:40,780 This is the only way to do it. 40 00:02:41,060 --> 00:02:42,710 So let's begin with the first one. 41 00:02:42,980 --> 00:02:51,770 If single income is between is bigger or equals one, because we don't want to take taxes from someone 42 00:02:51,770 --> 00:02:53,360 who doesn't make any profit. 43 00:02:53,700 --> 00:03:01,130 And and we use and because we have these two limits, so we want something to be bigger than one and 44 00:03:01,130 --> 00:03:03,280 smaller than two thousand is the way to do. 45 00:03:04,880 --> 00:03:05,270 All right. 46 00:03:05,280 --> 00:03:10,650 Single income like this, smaller equals than two thousand. 47 00:03:11,270 --> 00:03:11,720 All right. 48 00:03:11,730 --> 00:03:17,420 Because if we put some, for example, or here, so we're going to get under here under the if only 49 00:03:17,420 --> 00:03:21,170 values that are one or two thousand and we don't want it. 50 00:03:21,440 --> 00:03:27,080 We want to get everything which is between one and two thousand and not to get one or two thousand. 51 00:03:27,080 --> 00:03:27,330 Right. 52 00:03:27,950 --> 00:03:35,210 And now the thing that we want to do is take a single income and take five percent out of it. 53 00:03:35,220 --> 00:03:35,420 Right. 54 00:03:35,450 --> 00:03:36,770 So how do we do it? 55 00:03:37,580 --> 00:03:41,000 How do we take five percent, which is doing the following thing? 56 00:03:41,680 --> 00:03:42,140 All right. 57 00:03:42,150 --> 00:03:43,430 We're doing the following thing. 58 00:03:43,430 --> 00:03:47,960 We're taking we're multiplying it by zero dot zero five. 59 00:03:47,990 --> 00:03:48,970 This is five percent. 60 00:03:48,980 --> 00:03:49,320 All right. 61 00:03:49,770 --> 00:03:57,290 So and how how do I go to this conclusion even without knowing any mathematics if we do this thing? 62 00:03:58,040 --> 00:03:58,600 All right. 63 00:03:58,910 --> 00:04:06,320 So if we do this thing, we multiply as any number multiplied by one, we will get a hundred percent. 64 00:04:06,410 --> 00:04:09,320 Or in other words, we're going to get this value again. 65 00:04:09,320 --> 00:04:11,390 Right, because we got the 100 percent. 66 00:04:11,780 --> 00:04:15,740 But in this case, we want to get only five percent out of the whole value. 67 00:04:16,010 --> 00:04:19,730 So to get five percent, we need to multiplied by zero zero five. 68 00:04:19,790 --> 00:04:27,860 OK, so once we multiply like this, we want to put this value inside something. 69 00:04:27,860 --> 00:04:28,150 Right? 70 00:04:28,460 --> 00:04:33,830 So let's create an additional variable which which we can call it tax. 71 00:04:33,830 --> 00:04:34,250 Right. 72 00:04:34,880 --> 00:04:35,600 Like this. 73 00:04:36,350 --> 00:04:38,180 And this is what we're going to do. 74 00:04:38,810 --> 00:04:48,260 We're going to take the value, for example, one thousand five hundred multiplied by zero zero five. 75 00:04:48,440 --> 00:04:50,870 And this will be the tax that we got from it. 76 00:04:51,380 --> 00:04:56,060 OK, so we're going to do the same thing for the second element as well. 77 00:04:56,060 --> 00:05:06,110 If a single income is bigger or equals to 2001, because here we go up until 2000 and we don't want 78 00:05:06,110 --> 00:05:13,160 to put 2000 here as well, because then there is the same number here and here and it's collides. 79 00:05:13,850 --> 00:05:17,240 It's not good for us because the same number can go higher and higher as well. 80 00:05:17,580 --> 00:05:18,780 And it's not good for us. 81 00:05:19,040 --> 00:05:21,340 So we will start off 2001. 82 00:05:21,380 --> 00:05:21,760 All right. 83 00:05:22,490 --> 00:05:28,240 And single income up until how much do we have here? 84 00:05:28,250 --> 00:05:29,600 5000 like this. 85 00:05:29,600 --> 00:05:29,920 All right. 86 00:05:30,180 --> 00:05:38,570 And again, we just copy this thing and just change the the number of the tax percentage at the end. 87 00:05:38,810 --> 00:05:43,110 And what you want to put here is 10 percent of 10 percent is not one. 88 00:05:43,520 --> 00:05:44,090 All right. 89 00:05:44,480 --> 00:05:57,960 Afterwards, if single income bigger equals to five thousand and one and single income is smaller equals 90 00:05:58,250 --> 00:06:03,890 to fifteen thousand, I'm just applying like what I found here in this section. 91 00:06:04,040 --> 00:06:07,010 I'm just applying to you, applying the same thing here. 92 00:06:08,340 --> 00:06:10,150 And here as well, it's the same rule. 93 00:06:10,210 --> 00:06:17,790 OK, you see, I'm not just I'm not like investing any thinking after I figured out what to do here. 94 00:06:18,000 --> 00:06:22,870 I'm just copying the same thing, just changing the numbers here, here and here. 95 00:06:22,890 --> 00:06:24,810 OK, changing the limit. 96 00:06:25,890 --> 00:06:26,330 All right. 97 00:06:26,670 --> 00:06:31,380 Which the limit is this this thing right here and changing the taxes. 98 00:06:32,280 --> 00:06:33,420 The part right here. 99 00:06:33,790 --> 00:06:36,510 OK, this the only thing I'm doing. 100 00:06:37,080 --> 00:06:37,500 All right. 101 00:06:37,500 --> 00:06:41,360 So now we have five, a 500000. 102 00:06:41,670 --> 00:06:49,500 And for that we have we need to copy this thing again and copy it basically here. 103 00:06:50,790 --> 00:06:55,080 And for this thing, we need to take 15 percent. 104 00:06:55,710 --> 00:06:56,340 All right. 105 00:06:56,940 --> 00:07:08,480 And the last condition that we have is right here above 15000 will pay 17 percent for gross income. 106 00:07:08,670 --> 00:07:13,410 So everything which is not this thing, because here we covered all the numbers. 107 00:07:14,320 --> 00:07:17,310 We covered all the numbers from one to. 108 00:07:20,270 --> 00:07:29,410 Five fifteen hundred fifty fifteen, fifteen thousand, sorry, so we covered here fifteen thousand, 109 00:07:29,460 --> 00:07:35,600 OK, and now we're going to say else, which is everything which is bigger than fifteen thousand will 110 00:07:35,600 --> 00:07:39,800 be here and we're going to take taxes, which is 17 percent. 111 00:07:40,130 --> 00:07:48,760 And just going to copy this again and put it here and change it to 17 percent like this. 112 00:07:49,250 --> 00:07:53,000 OK, and we're done with a part of taking taxes. 113 00:07:54,350 --> 00:07:54,920 All right. 114 00:07:56,060 --> 00:08:01,520 And now I'm just going to use backslash backwards backspace, OK? 115 00:08:01,520 --> 00:08:05,600 Because I don't want to write code inside the house anymore. 116 00:08:05,960 --> 00:08:09,550 And I want to put it outside of the if else. 117 00:08:09,560 --> 00:08:14,960 OK, so where the cursor is blinking right now, it's outside this if else. 118 00:08:14,960 --> 00:08:17,510 OK, this is outside that if else. 119 00:08:17,870 --> 00:08:20,000 OK, all right. 120 00:08:21,620 --> 00:08:24,530 Just remove redundant spaces, OK. 121 00:08:25,370 --> 00:08:28,520 And right here I would like to do the following thing. 122 00:08:28,520 --> 00:08:31,280 I'm going to create a new variable net income. 123 00:08:32,090 --> 00:08:32,540 Yeah. 124 00:08:33,170 --> 00:08:35,840 And I'm going to do a single income. 125 00:08:38,740 --> 00:08:40,370 Minus tax. 126 00:08:41,280 --> 00:08:49,080 OK, so what I did here is take the single income, which is this number right here, for example, 127 00:08:49,570 --> 00:08:53,290 OK, and I'm going to remove the taxes, OK? 128 00:08:53,530 --> 00:09:01,360 So, for example, the result of here is going to be five percent, OK, this the tax number is five 129 00:09:01,360 --> 00:09:03,380 percent out of this number. 130 00:09:03,610 --> 00:09:11,800 OK, so let's say, for example, that for the first number, five percent is like 15. 131 00:09:11,800 --> 00:09:14,650 Just guessing know without calculation, just guessing 15. 132 00:09:14,680 --> 00:09:15,750 OK, for example. 133 00:09:16,270 --> 00:09:23,080 So if it's 15, I'm going to take the single income, which is the whole income right here, and I'm 134 00:09:23,080 --> 00:09:24,520 going to reduce the tax. 135 00:09:24,940 --> 00:09:33,790 OK, so I'm doing one thousand five hundred minus 15 and this will give us that net income. 136 00:09:33,940 --> 00:09:34,370 OK. 137 00:09:34,390 --> 00:09:41,110 Net income with this net income, what are we going to do is obviously is this section right here, 138 00:09:41,140 --> 00:09:47,770 OK, because we need to calculate the net income right here and reduce two percent out of it to find 139 00:09:47,770 --> 00:09:49,210 out what is the health care. 140 00:09:49,360 --> 00:09:49,780 All right. 141 00:09:49,780 --> 00:09:52,540 What is the health care amount that we need to pay? 142 00:09:52,810 --> 00:09:53,290 All right. 143 00:09:53,590 --> 00:09:57,490 So we're going to do the following thing now. 144 00:09:57,490 --> 00:10:02,740 We're going to calculate the calculate the income. 145 00:10:04,450 --> 00:10:07,420 After health care. 146 00:10:08,820 --> 00:10:15,270 Reduction, because this is what we were asked to do in the fifth section right here, just want to 147 00:10:15,270 --> 00:10:21,010 print it, just get the net income after reducing the two percent here and just print it. 148 00:10:21,780 --> 00:10:22,260 All right. 149 00:10:22,440 --> 00:10:23,230 Just print it. 150 00:10:23,490 --> 00:10:25,500 So this would be the net income. 151 00:10:26,700 --> 00:10:27,240 All right. 152 00:10:29,160 --> 00:10:29,970 Multiplied. 153 00:10:31,550 --> 00:10:32,640 By two percent. 154 00:10:33,210 --> 00:10:43,220 Yeah, and right, like the the health care reduction is two percent, two percent. 155 00:10:43,220 --> 00:10:43,690 Correct. 156 00:10:44,030 --> 00:10:53,000 So instead of doing reducing two percent and then then taking the net income and deducting this number, 157 00:10:53,210 --> 00:10:56,510 this number out of the net income, which is going to do the following thing. 158 00:10:57,020 --> 00:10:59,720 OK, zero dark. 159 00:10:59,720 --> 00:11:00,430 Ninety eight. 160 00:11:00,470 --> 00:11:06,880 OK, so we're taking the whole net income and we're multiplying it by 98 percent. 161 00:11:07,280 --> 00:11:16,320 And this would be the 98 percent that we have after reducing the health care right here. 162 00:11:16,340 --> 00:11:22,790 OK, so this results right here will take the net income and reduce two percent out of it because we're 163 00:11:22,800 --> 00:11:25,550 multiplying it by 98 percent. 164 00:11:25,730 --> 00:11:28,800 Is taking the net income multiplying it by 98 percent? 165 00:11:29,120 --> 00:11:34,640 This will give us the the income after reducing the health care. 166 00:11:34,790 --> 00:11:39,480 OK, it's a bit mathematical here, but this is the whole point, right? 167 00:11:39,860 --> 00:11:42,440 Like combining several topics all together. 168 00:11:42,470 --> 00:11:42,930 Correct. 169 00:11:44,180 --> 00:11:45,850 OK, we're good this far. 170 00:11:45,860 --> 00:11:46,770 Let's print it. 171 00:11:46,790 --> 00:11:53,930 OK, print printing income after health care reduction. 172 00:11:56,680 --> 00:12:01,150 Guaranteeing income after health care reduction. 173 00:12:02,150 --> 00:12:12,290 All right, so we're done with this part and now we're going to head off to the last part, OK, am 174 00:12:12,410 --> 00:12:13,080 right here. 175 00:12:13,100 --> 00:12:19,180 Calculate the total tax you got from the give in to businesses in the list, excluding health care. 176 00:12:19,310 --> 00:12:26,480 So we're just ignoring this pass right here, ignoring it, completely ignoring it completely, because 177 00:12:26,480 --> 00:12:35,560 for us, this thing doesn't doesn't come into calculation once we are talking about reduction of taxes. 178 00:12:36,350 --> 00:12:37,910 So we're going to do the following thing. 179 00:12:37,910 --> 00:12:38,190 Right. 180 00:12:38,660 --> 00:12:39,710 Total taxes. 181 00:12:41,160 --> 00:12:41,700 Is. 182 00:12:43,740 --> 00:12:44,880 Total taxes. 183 00:12:47,570 --> 00:12:48,350 Lost X. 184 00:12:49,770 --> 00:12:50,250 OK. 185 00:12:53,990 --> 00:12:56,510 So you see here. 186 00:12:57,660 --> 00:13:00,540 Total taxes can be you see that what I'm doing. 187 00:13:00,570 --> 00:13:02,700 You just need to learn from this practice as well. 188 00:13:02,850 --> 00:13:08,790 You see, I have here a brownish background like patroness, trying to tell me there is something wrong. 189 00:13:08,790 --> 00:13:12,200 It's not an error because it's not red, but something is a bit wrong. 190 00:13:12,210 --> 00:13:12,470 All right. 191 00:13:12,480 --> 00:13:20,340 So hovering over it, I can see name total taxes can be undefined, meaning that there can be a case 192 00:13:20,340 --> 00:13:23,340 where total taxes will have no value at all. 193 00:13:23,620 --> 00:13:26,760 OK, so he wants me to define it to something. 194 00:13:26,760 --> 00:13:28,230 Doesn't matter what does something. 195 00:13:28,650 --> 00:13:31,170 So I'm just going to define it here outside of the loop. 196 00:13:31,600 --> 00:13:38,040 Total taxes, but zero here or even the keyword, none like this. 197 00:13:38,260 --> 00:13:43,770 And just to define it to something so he won't shout at me here and it's none. 198 00:13:43,780 --> 00:13:45,990 OK, so let's see what I did here. 199 00:13:46,050 --> 00:13:47,880 OK, well, let's see what I did here. 200 00:13:48,780 --> 00:13:50,840 What actually did here is the following thing. 201 00:13:51,480 --> 00:13:53,520 Let's say we're going for the first run. 202 00:13:53,790 --> 00:13:57,190 We're taking this value and we're starting to run over the loop here. 203 00:13:58,130 --> 00:14:02,910 OK, so we have one thousand five hundred going from the top. 204 00:14:03,510 --> 00:14:06,390 And are we going inside this IEF? 205 00:14:06,930 --> 00:14:07,490 Are we. 206 00:14:07,950 --> 00:14:08,250 Yes. 207 00:14:08,510 --> 00:14:09,220 Yes, we are. 208 00:14:09,360 --> 00:14:09,780 Why? 209 00:14:09,780 --> 00:14:11,820 Because it's one thousand five hundred. 210 00:14:11,820 --> 00:14:14,690 It comes inside this limits right here, correct? 211 00:14:14,940 --> 00:14:15,260 Yeah. 212 00:14:16,080 --> 00:14:17,460 OK, now what happens? 213 00:14:17,820 --> 00:14:24,100 We're taking the single income, which is the one thousand five hundred, multiplying it by five percent. 214 00:14:24,320 --> 00:14:30,120 OK, this will give us the tax that we get from that 100 percent. 215 00:14:30,430 --> 00:14:32,430 OK, this is the one hundred percent. 216 00:14:32,430 --> 00:14:36,300 One thousand five hundred is the whole number, the one hundred percent. 217 00:14:36,840 --> 00:14:41,520 We want to know how much is five percent out of this whole number. 218 00:14:42,000 --> 00:14:43,290 And this is the tax. 219 00:14:44,520 --> 00:14:52,800 So we got the text of the first number going downwards with the code, are we doing something in this? 220 00:14:52,800 --> 00:14:59,870 If no, because we already got into the first if something, he'll also know something inside the house. 221 00:14:59,880 --> 00:15:01,380 Also, nothing happens here. 222 00:15:01,800 --> 00:15:05,520 OK, we now completed the if al spot. 223 00:15:05,940 --> 00:15:07,910 Now we're coming to this pass right here. 224 00:15:07,950 --> 00:15:08,320 Right. 225 00:15:09,660 --> 00:15:11,610 So here we have the following thing. 226 00:15:11,610 --> 00:15:19,230 OK, here we're taking the tax that we have, OK, the tax from here, this value that I'm marked right 227 00:15:19,230 --> 00:15:26,310 here, taking the tax and we're taking the single income, OK, which is this one, one thousand five 228 00:15:26,310 --> 00:15:26,760 hundred. 229 00:15:27,270 --> 00:15:30,330 And we're reducing from the single income. 230 00:15:31,530 --> 00:15:32,430 The Texas. 231 00:15:33,510 --> 00:15:38,640 OK, this will give us the net income, this is the net money that we're going to have in our hands 232 00:15:38,640 --> 00:15:41,400 after we're reducing the taxes. 233 00:15:41,670 --> 00:15:51,210 OK, after we completed this thing, now we want to know right here, as we already discussed, all 234 00:15:51,210 --> 00:15:56,080 businesses will pay additional two percent full health care from the net income. 235 00:15:56,490 --> 00:15:57,710 OK, just print it. 236 00:15:59,460 --> 00:16:07,770 So we're having here getting the net income that we have, net income and we want to know how much money 237 00:16:07,770 --> 00:16:10,920 do we have in our hands after using these two percent? 238 00:16:11,190 --> 00:16:15,200 OK, so in total, we have 19, eight percent of our salary. 239 00:16:15,690 --> 00:16:19,720 So just take the net income and multiply by 98 percent. 240 00:16:20,120 --> 00:16:25,260 OK, so this is the money that we have after paying for health care. 241 00:16:26,640 --> 00:16:35,140 Then we're going to the seventh section right here, six section, sorry, while excluding health care. 242 00:16:35,160 --> 00:16:43,260 So this part for us, it does not exist anymore at all because now we're in the sixth section and it 243 00:16:43,260 --> 00:16:44,690 says here, exclude health care. 244 00:16:44,850 --> 00:16:47,120 So we ignore this part completely. 245 00:16:47,160 --> 00:16:48,150 We don't care about it. 246 00:16:48,390 --> 00:16:50,040 Here we did some calculation. 247 00:16:50,190 --> 00:16:55,170 We created a new variable income after a health care reduction. 248 00:16:55,170 --> 00:16:57,900 But this net income stays the same. 249 00:16:58,200 --> 00:16:59,400 OK, stays the same. 250 00:16:59,630 --> 00:17:02,190 And actually, we don't care about it at all. 251 00:17:02,250 --> 00:17:04,740 OK, because now we're going to deal with the taxes. 252 00:17:05,070 --> 00:17:07,260 This part right here talks about the taxes. 253 00:17:07,260 --> 00:17:10,050 We don't care about net income, not that income. 254 00:17:10,050 --> 00:17:10,880 We don't care about it. 255 00:17:10,890 --> 00:17:17,160 Now we're talking the taxes, the tax already collected here and it's safe for us in waiting for us. 256 00:17:17,160 --> 00:17:19,500 Nothing happened with this tax value. 257 00:17:19,620 --> 00:17:23,000 It stays the same as we started going from top to bottom. 258 00:17:23,490 --> 00:17:26,400 So we have already a number here of tax, OK? 259 00:17:27,510 --> 00:17:35,930 And in this part right here where we want to know what is the total tax you got from the given 10 businesses. 260 00:17:36,180 --> 00:17:42,480 So this loop here is going to go once, twice, three times, four times and so on until we complete 261 00:17:42,480 --> 00:17:43,950 the whole list right here. 262 00:17:43,960 --> 00:17:44,400 Correct. 263 00:17:45,000 --> 00:17:46,070 The whole list right here. 264 00:17:46,380 --> 00:17:50,050 It's going to go around at around 10 times, right? 265 00:17:50,070 --> 00:17:53,830 One, two, three, four, five, six, seven, eight, nine, 10 times. 266 00:17:53,860 --> 00:17:55,470 Going to go again and again and again. 267 00:17:55,710 --> 00:18:01,200 And we need to somehow collect in each cycle the taxes that we got. 268 00:18:01,650 --> 00:18:10,170 OK, so what I'm doing right now in this section right here, I'm just creating a new variable, which 269 00:18:10,410 --> 00:18:13,630 equals to nothing, OK? 270 00:18:13,660 --> 00:18:15,690 It equals nothing at the beginning. 271 00:18:15,690 --> 00:18:16,920 What's going the first time? 272 00:18:17,190 --> 00:18:18,510 It equals to nothing. 273 00:18:19,210 --> 00:18:20,580 And I'm saying the following thing. 274 00:18:21,180 --> 00:18:25,830 Take nothing and the first time and add that tax number. 275 00:18:25,950 --> 00:18:32,790 OK, we got the tax number from here at the first time and just take nothing, plus the tax that we 276 00:18:32,790 --> 00:18:40,710 got from the first cycle, OK, and put it inside here inside the total, for example, to make it easier 277 00:18:40,710 --> 00:18:45,130 for us to understand, let's say that we got in Texas here we got the number one. 278 00:18:45,240 --> 00:18:50,330 OK, just for the example, just for the theoretical example, let's say we have the number one here. 279 00:18:51,090 --> 00:18:55,320 OK, so there is nothing plus one. 280 00:18:56,520 --> 00:19:01,370 And all of this part, all of this part goes into here. 281 00:19:01,860 --> 00:19:05,610 So once getting to this goal, once getting to this goal right here. 282 00:19:06,090 --> 00:19:06,450 Right. 283 00:19:07,680 --> 00:19:15,450 We're having one here, OK, then we're finished now and this part right here, the first loop cycle 284 00:19:15,450 --> 00:19:24,120 finished and here we have one starting again with the second cycle, taking this number, going through 285 00:19:24,120 --> 00:19:29,300 all of this loop right here, going inside this part, inside this IV here. 286 00:19:29,310 --> 00:19:34,980 By the by the way, it's not if it's elif of course this also elif. 287 00:19:35,340 --> 00:19:35,760 Yeah. 288 00:19:36,660 --> 00:19:44,070 Because if we have more than one, if we use out if elif and at the end we use else in the second part 289 00:19:44,820 --> 00:19:50,430 we're starting from the top and we're seeing here the number two thousand five hundred forty two. 290 00:19:51,600 --> 00:19:56,680 It doesn't fit here because it's bigger than two thousand and the number of feeds over here. 291 00:19:57,180 --> 00:20:05,550 Again we take the taxes OK and going downwards and coming to this line again. 292 00:20:06,280 --> 00:20:08,940 OK, you remember what number we have here. 293 00:20:09,420 --> 00:20:10,320 We have here one. 294 00:20:11,640 --> 00:20:12,030 Right. 295 00:20:12,330 --> 00:20:14,420 And then we calculate this thing again. 296 00:20:14,730 --> 00:20:24,240 So here in total taxes, we have one from the previous cycle and then we adding it to the taxes that 297 00:20:24,240 --> 00:20:31,710 we got from the second cycle, from this number, OK, from this number we got here in the second cycle, 298 00:20:31,710 --> 00:20:37,130 inside this part, inside this ELIF and we got a tax number from here. 299 00:20:37,290 --> 00:20:46,410 So we taking that one number, number one that we got from the first cycle and adding it to tax variable. 300 00:20:46,680 --> 00:20:52,680 Tax variable is the taxes that we have taken from this variable right here. 301 00:20:52,980 --> 00:20:53,490 Correct. 302 00:20:53,790 --> 00:20:59,880 So then in the second cycle, what we did here, we took the taxes from the first cycle and added it 303 00:21:00,000 --> 00:21:03,660 to the number from taxes from the second cycle. 304 00:21:04,020 --> 00:21:07,110 And all of this got into total taxes. 305 00:21:08,650 --> 00:21:16,210 And then in the third cycle, we have Texas from cycle number one and number two, and they're added 306 00:21:16,210 --> 00:21:20,890 to Texas from cycle number three and so on and so on. 307 00:21:20,920 --> 00:21:26,980 So what eventually happens here that in Texas we have eventually at the end, once we finish this thing 308 00:21:26,980 --> 00:21:34,630 as well, we have our total taxes summed up again and again and again until we have all the taxes collected 309 00:21:34,630 --> 00:21:35,380 over here. 310 00:21:35,950 --> 00:21:36,370 All right. 311 00:21:37,780 --> 00:21:47,470 So now once we have it, let's go to the end of the to the most left part here, because we want to 312 00:21:47,470 --> 00:21:51,310 be outside of the loop now, OK, outside of the for loop. 313 00:21:51,460 --> 00:21:54,880 And as long as we have indention like this, we're inside the loop. 314 00:21:54,880 --> 00:21:58,180 Once we do backspace, we're outside of loop. 315 00:21:58,960 --> 00:22:11,800 And now I just want to print print the sum of print, total of taxes, OK, loss casting total of taxes. 316 00:22:12,320 --> 00:22:14,320 OK, that seems correct. 317 00:22:14,650 --> 00:22:16,870 Let's run it and see what happens. 318 00:22:18,360 --> 00:22:19,430 And we have an error. 319 00:22:19,500 --> 00:22:30,030 OK, so we have unsupported operator type plus non type and float in line number 46 and we're seeing 320 00:22:30,030 --> 00:22:31,930 here that we have some kind of error. 321 00:22:32,010 --> 00:22:35,330 Correct, because we're trying some type error. 322 00:22:35,340 --> 00:22:37,230 Unsupported operand. 323 00:22:38,860 --> 00:22:46,170 So we have some kind of error, we have types for the plus because we cannot add a non type and float. 324 00:22:47,170 --> 00:22:55,150 So I think the arrow is right here because we cannot add none to a number, so let's just zero here. 325 00:22:56,590 --> 00:22:57,600 Let's run it again. 326 00:22:59,270 --> 00:23:03,170 All right, all right, so I think we're good now. 327 00:23:04,790 --> 00:23:10,310 OK, so right here you can see the printing income after health care reduction. 328 00:23:10,670 --> 00:23:12,400 And let's just check ourselves. 329 00:23:12,410 --> 00:23:18,320 So we're seeing here, by the way, let's do an additional thing we're seeing here, the printout of 330 00:23:18,740 --> 00:23:21,170 income after health care reduction. 331 00:23:21,180 --> 00:23:21,740 Correct. 332 00:23:22,110 --> 00:23:23,900 But I want to do an additional thing. 333 00:23:24,140 --> 00:23:30,520 I want to print the print print of the tax variable. 334 00:23:30,830 --> 00:23:32,560 Yeah, I just want to print it as well. 335 00:23:35,060 --> 00:23:35,630 All right. 336 00:23:37,420 --> 00:23:47,860 And after these two printed, let's just do print and do have some spaces, so be more ordered for us 337 00:23:47,860 --> 00:23:48,410 like this. 338 00:23:49,450 --> 00:23:51,640 All right, so let's go to the top. 339 00:23:51,670 --> 00:24:00,040 OK, so from the first one from this guy right here, one thousand five hundred, we took seventy five 340 00:24:00,220 --> 00:24:02,530 dollars tax, OK? 341 00:24:02,800 --> 00:24:06,310 And then we have Brint income after health care reduction. 342 00:24:06,550 --> 00:24:10,720 It's one thousand three hundred ninety six. 343 00:24:11,940 --> 00:24:21,330 OK, so basically this is the tax that we took, OK, and this is the present income after health care 344 00:24:21,330 --> 00:24:21,930 reduction. 345 00:24:22,020 --> 00:24:22,350 All right. 346 00:24:22,800 --> 00:24:29,760 So let's just verify using a calculator and let's calculate if it's correct. 347 00:24:30,180 --> 00:24:32,700 OK, so we have 1500. 348 00:24:33,000 --> 00:24:43,880 OK, and first of all, we're reducing five percent, five percent taxes, so let's multiplied by zero 349 00:24:44,120 --> 00:24:44,980 zero five. 350 00:24:45,810 --> 00:24:49,800 So 75 is the same as we have here in the tax printout. 351 00:24:50,430 --> 00:24:57,870 And once we reduce the taxes, we have the net income income, which is one thousand five hundred minus 352 00:24:57,870 --> 00:24:58,850 75. 353 00:24:59,160 --> 00:25:00,450 This is our net income. 354 00:25:00,720 --> 00:25:01,180 OK. 355 00:25:01,440 --> 00:25:09,720 And from this summary right here, the net income, we're going to check out how much is 98 percent 356 00:25:09,720 --> 00:25:10,170 of it. 357 00:25:10,230 --> 00:25:16,740 OK, so this is one thousand three hundred ninety six point five, which is the exactly the number that 358 00:25:16,740 --> 00:25:19,440 we have print income after health care reduction. 359 00:25:20,310 --> 00:25:23,280 So our calculation is correct in the printout. 360 00:25:23,490 --> 00:25:28,350 And OK, so we see here the printout all along the way. 361 00:25:28,590 --> 00:25:33,780 And you can see here we have a float number with lots of number after a decimal. 362 00:25:33,990 --> 00:25:34,840 And who doesn't? 363 00:25:35,040 --> 00:25:35,970 We don't care about it. 364 00:25:36,130 --> 00:25:40,130 Like usually people don't use these numbers after a decimal point. 365 00:25:40,140 --> 00:25:46,050 We learn in the next videos how we can limit this to two numbers or three numbers doesn't matter. 366 00:25:46,380 --> 00:25:48,210 But for now, the correlation is good. 367 00:25:49,200 --> 00:25:55,560 And once taking all of these numbers of taxes altogether, we have fewer taxes. 368 00:25:55,920 --> 00:26:00,570 Print of total taxes, three thousand six hundred and seventy point forty five. 369 00:26:01,320 --> 00:26:04,590 This is the summary of all of these taxes right here. 370 00:26:05,490 --> 00:26:10,200 OK, so this is the code for all of these requirements right here. 371 00:26:10,410 --> 00:26:11,880 It's a bit challenging. 372 00:26:12,540 --> 00:26:19,730 All right, because you have lots of math here and percentage if you need some strengthening in percentage, 373 00:26:19,830 --> 00:26:25,130 go to Google and just learn quickly in 10 or 15 minutes how to use the percentage. 374 00:26:25,140 --> 00:26:31,200 It's not very difficult because if, for example, you want to know how much is five percent out of 375 00:26:31,200 --> 00:26:34,840 a number, you just multiplied by zero zero five. 376 00:26:34,910 --> 00:26:38,180 OK, if you want to know how much is 10 percent. 377 00:26:38,430 --> 00:26:43,230 So it's zero that one 15 percent, zero dollars 15. 378 00:26:43,560 --> 00:26:44,190 It's math. 379 00:26:44,190 --> 00:26:45,000 It's not programming. 380 00:26:45,000 --> 00:26:46,260 It's just simple math. 381 00:26:46,290 --> 00:26:53,400 OK, so, OK, this is a resolution for the practice part for for loops. 382 00:26:53,610 --> 00:26:56,550 I think that this sums up the four loops completely. 383 00:26:56,730 --> 00:26:59,670 And I think that now we are masters in full loops. 384 00:26:59,670 --> 00:27:07,740 If statements, variables, lists, lots of topics, I think we're done with about 70 percent of the 385 00:27:07,740 --> 00:27:14,820 pie out of the python course and and we're done with for loops in the next next videos. 386 00:27:14,820 --> 00:27:20,000 We're going to cover other loops as well, which are pretty much similar to follow. 387 00:27:20,050 --> 00:27:24,630 So if you understand for loops, the next videos will be pretty much easier for you. 388 00:27:25,680 --> 00:27:31,710 Just have some different characteristics with other with other loops. 389 00:27:31,920 --> 00:27:35,700 But it's pretty similar, pretty similar techniques for all four loops. 390 00:27:35,970 --> 00:27:41,350 Just the basic thing we're going around and around again and again in the loops. 391 00:27:41,370 --> 00:27:46,600 This is their purpose and I think we're done with this lecture. 392 00:27:47,010 --> 00:27:48,780 OK, great job, everyone. 393 00:27:49,020 --> 00:27:51,600 I will see you in the next video and bye bye.