1 00:00:01,170 --> 00:00:07,570 So in the studio, we're going to talk about those people in the program, so if you have two hundred 2 00:00:07,570 --> 00:00:16,710 thousand two hundred lines of court, if you want to check out the content, you this is the point of 3 00:00:17,340 --> 00:00:17,980 sale here. 4 00:00:18,180 --> 00:00:23,550 And then you print the will and you will see whether the program is going correctly or not. 5 00:00:24,330 --> 00:00:29,760 That's a basic way of determining any errors. 6 00:00:30,210 --> 00:00:38,330 And actually, it's very tough when you have long court like 300, 400 lines of code and tolerance of. 7 00:00:38,850 --> 00:00:47,760 And in that, uh, if you have those code and you just putting up shipments everywhere is very bad. 8 00:00:48,120 --> 00:00:51,220 And it's also time consuming and it's a waste. 9 00:00:51,360 --> 00:00:54,070 So that's why we need to be able to program. 10 00:00:54,090 --> 00:01:02,210 So what this means is you can stop the program at a certain point and you can inspect the contents up 11 00:01:02,220 --> 00:01:09,570 to that point, and then you can chip through the program called one one instruction per day. 12 00:01:10,590 --> 00:01:13,720 So now we are going to do this now quick on this here. 13 00:01:13,740 --> 00:01:20,370 There is a place and it has a hidden section, but there is the bug and this is the debugger. 14 00:01:20,580 --> 00:01:28,000 And if you click on this sideboard open and click on this romantical and it will ask what to do with 15 00:01:28,030 --> 00:01:29,570 that file. 16 00:01:29,640 --> 00:01:34,620 So we need to see this pattern, currently active python working on this one. 17 00:01:35,820 --> 00:01:37,900 And you can see there are some controls here. 18 00:01:38,520 --> 00:01:40,330 So this one is the pause button. 19 00:01:41,700 --> 00:01:42,100 OK. 20 00:01:42,360 --> 00:01:47,730 Now, this program has been executed directly because we did not set the breakpoint. 21 00:01:48,000 --> 00:01:55,760 So this breakpoint, whenever it was hit by the Python interpreter, the program for us stops. 22 00:01:56,310 --> 00:01:57,380 Sorry, sir. 23 00:01:58,050 --> 00:02:04,610 I'm going to set the breakpoint just before this for you can set the breakpoint here. 24 00:02:05,590 --> 00:02:12,300 Uh, you can see the, uh, right to this box and you can see there is a column and you can set the 25 00:02:12,780 --> 00:02:15,050 red dot and it says Bridgepoint. 26 00:02:15,390 --> 00:02:19,790 Now, what I want to do is I want to run this now program and execute this line. 27 00:02:19,890 --> 00:02:24,400 But at starting up this right, it will wait for it to execute. 28 00:02:24,810 --> 00:02:28,390 So we need to manually step through this are the order of the court. 29 00:02:28,740 --> 00:02:29,700 Now, let me run. 30 00:02:29,700 --> 00:02:32,130 And David, going on despite pattern. 31 00:02:37,630 --> 00:02:44,160 Now, as you can see, there is a little color line indicating that the U.S. is going to be this one, 32 00:02:44,620 --> 00:02:52,270 and if you expand here, we got the local news that is Al Elizalde, and it is a variable containing 33 00:02:52,270 --> 00:02:57,650 the values of this, uh, content of any of these values. 34 00:02:58,270 --> 00:03:05,530 So you can see l can condense all this, uh, function variables and you can see index on and all those 35 00:03:05,530 --> 00:03:06,070 variables. 36 00:03:06,430 --> 00:03:09,340 Now, what you want is I want to do this program. 37 00:03:09,340 --> 00:03:11,510 I want to execute for only once. 38 00:03:11,860 --> 00:03:14,590 So these are the controls. 39 00:03:14,590 --> 00:03:16,150 I can control the program. 40 00:03:16,630 --> 00:03:19,890 So if you click on this continues, the program continues to the end. 41 00:03:20,410 --> 00:03:23,510 And if there is any breakpoint, then it will stop there. 42 00:03:24,040 --> 00:03:26,160 And this one is a step over. 43 00:03:26,680 --> 00:03:30,040 If you don't want to hear this one, you can step over this. 44 00:03:32,080 --> 00:03:38,120 If there is a function here and you're going to step over the function, you need not go to this function. 45 00:03:38,440 --> 00:03:42,490 So if you want to step into it, we step exactly one instruction. 46 00:03:42,640 --> 00:03:48,760 And if you are reading inside the thousand lines of code of a function, then if you want to step out 47 00:03:48,760 --> 00:03:53,030 of that function, you can see what this is, the restart and this is a stop. 48 00:03:53,410 --> 00:03:57,430 Now, I'm going to step into now this instruction gets a good. 49 00:03:59,060 --> 00:04:01,560 Now, if you can see, I bet you used. 50 00:04:02,600 --> 00:04:11,420 And next U.S., I am going to print it and it is going to be if I click on this, uh, step into print 51 00:04:11,420 --> 00:04:19,530 of a love I love, that is now a we get printed, as you can see, the output. 52 00:04:19,970 --> 00:04:22,610 The city certainly can also see the cards stacked here. 53 00:04:24,380 --> 00:04:31,970 And now we are going to use this again because it will exist until the end of this, uh, list. 54 00:04:33,170 --> 00:04:37,100 Now, I'm going to go this step into step again. 55 00:04:37,310 --> 00:04:43,570 You can see the second world now in that same way, you can print out the elements, step into step 56 00:04:43,580 --> 00:04:46,810 in twos and step two times to print one element. 57 00:04:47,750 --> 00:04:56,300 And now this condition is going to be checked Ivory's fight and then tough and off. 58 00:04:56,300 --> 00:05:00,900 This list is six and this is it we take with. 59 00:05:01,280 --> 00:05:06,890 So, no, it will get out of this for now. 60 00:05:06,890 --> 00:05:14,090 As you can see, this instruction pointer is pointing to is crucial to know if you go a step into this, 61 00:05:14,420 --> 00:05:17,450 we can see a new word has been added, easy to do. 62 00:05:17,810 --> 00:05:20,110 And if we step through this again, we use too far. 63 00:05:20,570 --> 00:05:27,380 Now, the if condition is going to be it is going to be close to find if you are greater than be. 64 00:05:27,650 --> 00:05:34,310 So it is not going to be that way to pass to the next condition to step into this. 65 00:05:34,310 --> 00:05:41,210 You can see this statement is not executed because he he's not resentful against each other. 66 00:05:41,210 --> 00:05:45,950 Is course to be A and B are both equally into this now. 67 00:05:45,950 --> 00:05:47,600 It will get out of this. 68 00:05:47,630 --> 00:05:55,430 Uh, it is wrong because these two conditions fail and of course, is will execute every condition other 69 00:05:55,430 --> 00:05:56,060 than this one. 70 00:05:56,810 --> 00:05:58,250 And I will go to print nothing. 71 00:05:59,430 --> 00:05:59,900 I will. 72 00:05:59,900 --> 00:06:02,840 As you can see, our program director has been closed. 73 00:06:03,410 --> 00:06:04,910 So that's sad about this. 74 00:06:05,750 --> 00:06:06,860 I hope you have understood. 75 00:06:07,340 --> 00:06:16,730 So don't worry, I will include, uh, uh, this Windows expert and also assembly language. 76 00:06:16,730 --> 00:06:19,250 Then you will get much more idea of debugging. 77 00:06:19,460 --> 00:06:21,530 But this is generally the high level. 78 00:06:22,190 --> 00:06:27,400 You just put the breakpoint over here and then you step into this program. 79 00:06:29,000 --> 00:06:30,500 Now, I want to show you this. 80 00:06:30,500 --> 00:06:37,310 I will also say that if before if I am going to run any current pattern for. 81 00:06:40,260 --> 00:06:41,790 So now I'm going to. 82 00:06:44,230 --> 00:06:54,590 On this one, I'm getting three values, so now if I want to leave out of this, I can just simply continue 83 00:06:55,010 --> 00:06:59,490 and continue will go on continuing our or the core. 84 00:06:59,510 --> 00:07:02,040 And if there are any requirements, it will stop there. 85 00:07:02,090 --> 00:07:03,590 Now, let's continue. 86 00:07:10,410 --> 00:07:19,830 So at this point, OK, no, as you can see out the open then it has been, uh, program has been paused 87 00:07:19,840 --> 00:07:21,950 here because this is the breakpoint point. 88 00:07:22,170 --> 00:07:24,330 I continue here, the program. 89 00:07:24,330 --> 00:07:29,480 Just print out the print and I nothing just continuing the program. 90 00:07:30,930 --> 00:07:39,450 So that's what I hope we have understood that in the breakpoints and, uh, skipping through the program 91 00:07:39,540 --> 00:07:40,630 that sorry about that. 92 00:07:41,490 --> 00:07:42,590 This is very important. 93 00:07:42,600 --> 00:07:49,700 And when you have written so much lines of code and then worrying about the, uh, available input, 94 00:07:50,730 --> 00:07:54,930 so this debugging is used for, uh, solving these logical errors.