1 00:00:02,280 --> 00:00:02,840 Hi guys. 2 00:00:02,840 --> 00:00:03,800 Welcome to this session. 3 00:00:03,800 --> 00:00:09,840 So in this session we'll see how we can make use of ChatGPT for debugging any type of code as well. 4 00:00:10,200 --> 00:00:12,640 So let's give it a specific scenario. 5 00:00:12,640 --> 00:00:17,640 So what we are going to do is possibly ask it to first generate a code. 6 00:00:17,760 --> 00:00:24,040 And then we'll modify it, mess it up a little bit, and then give it as our code to the tool to check 7 00:00:24,040 --> 00:00:26,520 whether it is able to spot the error or not. 8 00:00:30,080 --> 00:00:33,080 So we're giving it a specify asking it to create a Python code. 9 00:00:35,280 --> 00:00:42,640 To generate the let's say Fibonacci series, Funaki series, as you know, is a series of numbers, 10 00:00:42,640 --> 00:00:46,040 which is basically the next number is a sum of the previous two numbers. 11 00:00:46,320 --> 00:00:50,240 So I'm asking it to generate a Python code to generate the Fibonacci series. 12 00:01:00,280 --> 00:01:03,880 So as you can see, it has gone ahead and created the code over here. 13 00:01:03,880 --> 00:01:08,120 So we can go ahead and take this. 14 00:01:13,360 --> 00:01:15,000 So we have the answer over here. 15 00:01:15,680 --> 00:01:19,160 And now we can go ahead and modify it. 16 00:01:19,720 --> 00:01:21,400 So we're going to paste it over here. 17 00:01:21,600 --> 00:01:25,100 And let's say we are going to modify this. 18 00:01:34,980 --> 00:01:37,260 I will say that here is my code. 19 00:01:42,340 --> 00:01:42,860 Not. 20 00:01:45,740 --> 00:01:48,060 Giving the right output. 21 00:01:53,380 --> 00:01:54,700 What is wrong with it? 22 00:02:00,140 --> 00:02:04,660 So now we are giving it as a question asking it that this is a specific code I have written. 23 00:02:04,700 --> 00:02:09,340 There is a mistake in the calculation of the next term in your code. 24 00:02:09,340 --> 00:02:12,900 You're adding this, which is exactly what we had pointed out. 25 00:02:12,940 --> 00:02:13,140 Okay. 26 00:02:13,180 --> 00:02:14,620 It should have been one. 27 00:02:14,660 --> 00:02:16,540 We have changed that to two over here. 28 00:02:16,780 --> 00:02:17,220 Okay. 29 00:02:17,380 --> 00:02:20,540 So replace this with one. 30 00:02:20,540 --> 00:02:24,140 It's giving a clear example of how to do it. 31 00:02:24,140 --> 00:02:28,140 And now it has also given us the corrected code as well which we can apply. 32 00:02:28,340 --> 00:02:34,060 So this is how you can give it any code which you're writing, which you have written or which was already 33 00:02:34,060 --> 00:02:38,580 there with you, which you want to, which is not running specifically on any platform. 34 00:02:38,580 --> 00:02:43,940 And it can correct it, tell you the line item where the error is, and give you the solution of it 35 00:02:43,940 --> 00:02:46,900 as well, which you can replace in the code and make it work.