WEBVTT 00:00.560 --> 00:04.180 Come back when you lecture and I'm back on my some example. 00:04.290 --> 00:10.290 So in this letter we are going to talk about global and local very well so all the variables that are 00:10.380 --> 00:17.610 outside any function outside the loop or outside everything and can be used globally for global that 00:17.610 --> 00:18.330 he was. 00:18.330 --> 00:25.230 That means if I define X here and I can use it any way I can use that inside a function I can use that 00:25.260 --> 00:26.460 insight into. 00:26.610 --> 00:28.040 So there is no restriction. 00:28.080 --> 00:30.350 That means this is a global variable. 00:30.480 --> 00:36.490 And the value of X is going to remain S10 at every place unless and and then I change it. 00:36.630 --> 00:39.660 So that means X is spent and it's a global variable. 00:39.660 --> 00:41.510 And I can use it anywhere. 00:41.610 --> 00:46.500 Now if I take any evil inside this function maybe set a stan. 00:46.770 --> 00:49.800 So this particular value is local very human. 00:49.800 --> 00:56.260 That means that it is only defined inside this particular function and cannot be used anywhere else. 00:56.280 --> 01:00.090 And if I tried to access it it is going to give me an error. 01:00.240 --> 01:03.590 So let me take a simple example first. 01:04.650 --> 01:08.690 So if I tried to build this basic song I got my result. 01:08.700 --> 01:11.220 That means my X and Y are working. 01:11.310 --> 01:13.210 So you are doing that some. 01:13.230 --> 01:18.570 If I tried to print by X here and in the next line if I tried to print my 01:22.970 --> 01:27.610 that means my X and Y are accessible inside dysfunction antoh. 01:27.830 --> 01:31.740 But what if I even knew what the bill inside me function Zais. 01:31.940 --> 01:36.300 I never tried to print any of it is it is going to give me an answer. 01:36.440 --> 01:50.720 So if I said I as 50 and trying to insert hair and alter type of trendies hair let me keep my eyes and 01:51.610 --> 01:54.740 let me and a line had. 01:54.830 --> 01:56.320 Now you can check out the error. 01:56.340 --> 02:00.460 So what actually happened is I took my exit my as global variables. 02:00.470 --> 02:05.380 That means they can be accessible from any point and mindset as local variable. 02:05.570 --> 02:08.300 So for me I call this particular function. 02:08.480 --> 02:15.160 That means these two statements of print the x y z and now don't say a function I can access global 02:15.160 --> 02:15.790 variables. 02:15.790 --> 02:19.950 That means my X and Y and also my local variables say. 02:20.060 --> 02:26.800 Now the next thing I did is printed this line and then I printed my X in my studies a global variable. 02:26.810 --> 02:33.780 I was even duping them but while trying to print said I got an error that day is not defined. 02:33.950 --> 02:38.690 That means I cannot exist outside my particular function. 02:39.170 --> 02:46.200 So to make this set as a global variable all I have to do is define ZEC as Luban. 02:46.220 --> 02:52.140 The simplest way is use of global keyword and then defines it as global. 02:52.280 --> 02:59.180 Now what I've done is I've declared it as global and more value I'm giving Buzek can be accessed anywhere 02:59.240 --> 03:00.330 outside functional. 03:00.340 --> 03:03.450 So let me run come on here. 03:06.600 --> 03:08.130 You can check out my design. 03:08.190 --> 03:14.790 So the first result are inside function and the next three days are outside function and they were perfectly 03:14.790 --> 03:15.430 fine. 03:15.690 --> 03:20.690 So the movie was this little was to make you understand about global and local variable. 03:21.020 --> 03:27.480 So the next one we are moving forward really well with all the Python stuff and I'm glad that you are 03:27.480 --> 03:32.860 continuing with your patience and I hope you complete discourse with on the concepts.