WEBVTT 00:00.470 --> 00:02.910 They come back let us talk about try. 00:02.940 --> 00:03.490 Except. 00:03.490 --> 00:03.820 Else. 00:03.820 --> 00:08.550 And finally you might be thinking of what is this is and what is this. 00:08.550 --> 00:12.760 Finally let us execute that and talk about it. 00:12.800 --> 00:16.710 So I need to add one more block of code that this is. 00:16.860 --> 00:22.920 I mean this let me bring something like inside is also I need to create one more block of code that 00:22.930 --> 00:26.190 is finally and let me print inside. 00:26.190 --> 00:30.320 Finally Now let me in on this one. 00:30.370 --> 00:35.680 I would be digging to condition the first one is without error and the second one is I will be taking 00:35.680 --> 00:41.850 some inner heavy gold 50 and then things work fine. 00:41.880 --> 00:44.650 I go inside my tribe look there was loiterer. 00:44.660 --> 00:47.000 So I haven't touched my exit block. 00:47.220 --> 00:50.690 Then you can see the result from inside is then inside. 00:50.700 --> 00:56.780 Finally And then my new line in my wrist and that means I'm not getting any error then I'm going to 00:56.780 --> 00:57.750 teach ins. 00:57.780 --> 01:04.290 And finally for short so I can add any Then when we're talking old what type of counting goes inside 01:04.290 --> 01:10.260 this blocks what that means if we are getting the correct result if you're not getting any error then 01:10.330 --> 01:12.210 else and finally we'll walk. 01:12.380 --> 01:12.830 OK. 01:12.870 --> 01:14.780 Let me take my second guess. 01:14.960 --> 01:17.520 If we get 50 and then zero. 01:17.990 --> 01:20.910 Hey you can see I was inside my exit block. 01:21.030 --> 01:25.160 So I got a zero and then I missed my flop. 01:25.170 --> 01:27.780 I'm not getting any result from my else. 01:28.050 --> 01:35.850 And then I got results from widely vinous you can conclude that if our result is fine if everything 01:35.850 --> 01:40.560 is working perfect that means we will be touching dry is. 01:40.590 --> 01:46.960 And finally if we have some error we have some exception then we'll be touching except. 01:46.990 --> 01:55.260 And finally so finally we'll be executed for both the cases when we executed only when we don't have 01:55.260 --> 01:56.600 any exceptions. 01:56.700 --> 02:04.100 That means we can use finally to add some calls that need to be executed after this line of code. 02:04.470 --> 02:10.810 So you really be ADD database reconnecting called while performing some task and I try block. 02:10.860 --> 02:16.650 Maybe something that is related to adding fields to our database or sending some values or trying to 02:16.650 --> 02:19.440 log in or log out at that point of time. 02:19.460 --> 02:25.170 We leave a database as well as some data and there are chances that we make dossed connection with our 02:25.180 --> 02:32.520 database so we know that finally will be executed every time so we add code regarding going into our 02:32.520 --> 02:35.000 database in this finally block. 02:35.250 --> 02:38.390 You can use for lot more things you might need to send. 02:38.430 --> 02:42.120 Sober report of that every time there's an execution. 02:42.180 --> 02:43.790 We can try a lot more things. 02:43.980 --> 02:50.740 So this is the reason that we have four blocks now and I hope my understanding try is to handle except 02:50.740 --> 02:55.680 as to throw our exception as is when we have successful try. 02:55.890 --> 03:03.900 And finally even before both the cases I hold no one to about as block as well as finally So finally 03:03.900 --> 03:10.080 is really really important when you are working with important stuff like acting with database or signing 03:10.080 --> 03:13.560 some report or logging some function or something else. 03:13.560 --> 03:15.950 So you have to understand about them. 03:16.050 --> 03:21.570 I hope slitty was helpful in the next letter when we're talking about how to create your own exception 03:21.570 --> 03:24.250 class to see you in the next one.