1 00:00:00,530 --> 00:00:05,530 Here in this video, we are going to discuss Biton keywords and identifiers. 2 00:00:07,540 --> 00:00:09,870 So first, we're starting with the python keywords. 3 00:00:10,360 --> 00:00:12,940 So keywords are the reserve words in Python. 4 00:00:13,120 --> 00:00:18,040 Like any of the programming languages, Python has got multiple different keywords. 5 00:00:18,460 --> 00:00:25,720 So during coding, your words can be used as a variable name and function name or any other identified. 6 00:00:26,040 --> 00:00:32,050 That means keywords are reso for the keyword purpose only they cannot be used as a variable name or 7 00:00:32,050 --> 00:00:36,160 say identifier or a function name, model, limb and so on. 8 00:00:36,460 --> 00:00:38,680 So that's why this keywords are designed for them. 9 00:00:39,670 --> 00:00:45,880 So these are they are used to define the syntax and the structure of the python language. 10 00:00:46,300 --> 00:00:53,350 So innervate Python tutorial will be using almost all keywords in different sections has when required. 11 00:00:53,910 --> 00:00:56,650 So keywords are the sensitive in Python. 12 00:00:58,030 --> 00:01:04,090 So at least this is this is the least of different keywords available, and you can find that here to 13 00:01:04,090 --> 00:01:06,120 her having 33 keywords. 14 00:01:06,460 --> 00:01:09,040 So one, two, three, four, five columns a day. 15 00:01:09,340 --> 00:01:13,030 And one, two, three, four, five, six, seven rule rules out there. 16 00:01:13,360 --> 00:01:15,610 So here we are having 33 keywords. 17 00:01:15,910 --> 00:01:19,480 And all these keywords will be discussed in the next videos. 18 00:01:19,660 --> 00:01:24,100 Has Wendy quit because they without them, we cannot write a word called. 19 00:01:25,440 --> 00:01:28,980 Let us discuss Bryton identifiers, so Biton. 20 00:01:29,040 --> 00:01:36,090 I didn't furze is nothing but the names given to the entities like your class functions, variables, 21 00:01:36,210 --> 00:01:36,710 etc. 22 00:01:37,020 --> 00:01:43,860 So that's why they will be known as identifiers and they'll be used to name a class to name a variable, 23 00:01:44,010 --> 00:01:46,740 to name a function in Python. 24 00:01:47,160 --> 00:01:51,450 It helps us in differentiating one entity from another entity. 25 00:01:51,480 --> 00:01:56,280 So that's why all the function names should be distinct, all the variable names should be distinct. 26 00:01:56,890 --> 00:01:59,100 So rules for writing identifiers. 27 00:01:59,370 --> 00:01:59,880 So I did. 28 00:01:59,880 --> 00:02:05,670 The first can be a combination of letters in the Lorqess or in the upper class letters that is capital 29 00:02:05,700 --> 00:02:10,890 eight to capital Z are digits ranging from zero to nine or an underscore. 30 00:02:10,980 --> 00:02:11,730 Like this one. 31 00:02:11,970 --> 00:02:16,080 So these are the valid characters in our identifiers. 32 00:02:17,430 --> 00:02:24,860 Names like the My Class one but underscore two and display underscore two under source code screen. 33 00:02:25,080 --> 00:02:29,640 So these are all the valid examples of these identifiers. 34 00:02:30,250 --> 00:02:32,700 So I did the first kind of start with the digit. 35 00:02:33,360 --> 00:02:35,850 So one variable is not valid. 36 00:02:35,910 --> 00:02:37,670 It is invalid by the variable. 37 00:02:37,670 --> 00:02:40,820 The one can be treated as a valid identified. 38 00:02:42,120 --> 00:02:45,160 Key words cannot be used as I did the facts. 39 00:02:45,430 --> 00:02:52,060 We cannot use special symbols like good exclamation at the rate of hash, dollar or sentence symbols, 40 00:02:52,420 --> 00:02:54,850 etc. in about 18 different names. 41 00:02:55,240 --> 00:02:58,930 So these rules are mostly common in almost all programming languages. 42 00:02:59,170 --> 00:03:03,880 But in Python, these are the rules to be followed while defining identifiers. 43 00:03:04,210 --> 00:03:07,290 So let us go for some demonstration for the better understanding. 44 00:03:08,290 --> 00:03:12,490 Biton is having multiple different keywords here in this demonstration. 45 00:03:12,520 --> 00:03:13,960 We shall discuss some of them. 46 00:03:14,470 --> 00:03:17,320 The Foskey, what we're going to discuss that is true and false. 47 00:03:17,380 --> 00:03:22,760 Remember, too, is starting with the capital letter D, and rest of the letters will be in the Lorqess. 48 00:03:22,780 --> 00:03:27,370 And in case of false, also the same apartness, a look as syntax will be maintained. 49 00:03:27,970 --> 00:03:31,570 So here we are having a five equal to equal to five and five. 50 00:03:31,600 --> 00:03:32,130 Get it done. 51 00:03:32,140 --> 00:03:32,400 Five. 52 00:03:32,470 --> 00:03:35,560 You can find that we're getting the outcome as true and false. 53 00:03:35,590 --> 00:03:38,830 So here the two unfolds are nothing but the keywords in Python. 54 00:03:39,460 --> 00:03:40,510 They're going to have the next one. 55 00:03:40,540 --> 00:03:41,470 That is of a none. 56 00:03:42,010 --> 00:03:43,210 So none. 57 00:03:43,270 --> 00:03:44,230 Izabel Izabel ejido. 58 00:03:44,290 --> 00:03:45,610 Now, let me go for the outcome. 59 00:03:46,180 --> 00:03:47,360 So it is producing. 60 00:03:47,360 --> 00:03:48,360 The output is true. 61 00:03:48,400 --> 00:03:52,230 That is none is not due to non is not equal to false noni's. 62 00:03:52,300 --> 00:03:56,230 Not like an empty list and nonphysical izabela non. 63 00:03:56,410 --> 00:04:00,220 It is returning me to know what is the use of non actually. 64 00:04:00,310 --> 00:04:01,450 So let me go for this. 65 00:04:01,910 --> 00:04:03,280 How do I define one function? 66 00:04:03,310 --> 00:04:06,760 The name of the function is a void function because it is white. 67 00:04:06,790 --> 00:04:07,030 Why? 68 00:04:07,090 --> 00:04:09,040 Because it does not return any value. 69 00:04:09,640 --> 00:04:16,360 So now if we return, if we assign to X and if we then print X, then obviously we shall get the non 70 00:04:16,480 --> 00:04:17,210 as the outcome. 71 00:04:17,350 --> 00:04:18,670 You can find that we are getting none. 72 00:04:19,330 --> 00:04:21,280 But here if the function returns. 73 00:04:24,530 --> 00:04:30,200 They've been find that it is returning the value see value upsy as they go to three hit and three is 74 00:04:30,200 --> 00:04:30,800 getting printed. 75 00:04:30,830 --> 00:04:36,230 But if we just make this line on it, if we just omit this line, you are getting the outcome as not 76 00:04:36,230 --> 00:04:38,680 because the function returns none. 77 00:04:40,250 --> 00:04:46,110 Next one is there and ah, and not so true and true, true and true outcome will be two and two outcome 78 00:04:46,150 --> 00:04:47,610 will be true and false. 79 00:04:47,780 --> 00:04:49,250 The outcome will be false. 80 00:04:49,880 --> 00:04:53,750 True or false, the outcome will be true and not false. 81 00:04:54,050 --> 00:04:55,340 Outcome will be true here. 82 00:04:55,910 --> 00:04:57,920 So in this way, you can go for other combinations. 83 00:04:57,930 --> 00:05:00,440 So let me write some other combinations here. 84 00:05:03,390 --> 00:05:05,310 So let us suppose I'm going for true and true. 85 00:05:07,900 --> 00:05:10,800 And when four of true false. 86 00:05:11,010 --> 00:05:13,530 So here we are having this true or true. 87 00:05:13,950 --> 00:05:15,330 And if you go for that to here. 88 00:05:16,630 --> 00:05:19,270 So, no, let me check what is the outcome we are going to get? 89 00:05:19,300 --> 00:05:21,700 So true and true is true. 90 00:05:21,940 --> 00:05:25,900 True or true is true and not true is false here. 91 00:05:25,930 --> 00:05:28,750 So that is another way to get the outcome. 92 00:05:28,770 --> 00:05:32,760 And here to discuss that is the end are and not keywords. 93 00:05:33,580 --> 00:05:38,680 Now we are going to have this as so import Matt as my Matt. 94 00:05:38,830 --> 00:05:41,980 So here we are having this alias of this model, Matt. 95 00:05:42,310 --> 00:05:47,050 So here had the key word as has been used and in the rest of the code he'll be using my Matt. 96 00:05:47,350 --> 00:05:52,660 Not the matter because Matt has got this model has got renamed to my Matt in this application. 97 00:05:52,990 --> 00:05:57,130 So my method accosts my method metadata by in this way you can go for the output. 98 00:05:58,580 --> 00:06:03,290 Next one is the SRT after S02 using the right one boolean statement. 99 00:06:03,650 --> 00:06:05,320 So five geddit, then five. 100 00:06:05,390 --> 00:06:07,110 It is producing assertion error. 101 00:06:07,610 --> 00:06:10,560 So that's why it had some S.R. data is taking place. 102 00:06:10,590 --> 00:06:10,850 But if. 103 00:06:10,850 --> 00:06:11,040 Right. 104 00:06:11,040 --> 00:06:11,300 Right. 105 00:06:11,450 --> 00:06:12,830 Five get it done for. 106 00:06:13,790 --> 00:06:18,710 So after I say to all those who write, you should write some expression which in return some boolean 107 00:06:18,860 --> 00:06:19,210 output. 108 00:06:19,220 --> 00:06:20,190 That is a true and false. 109 00:06:20,260 --> 00:06:23,940 So some condition has to be written after this aside, after that search. 110 00:06:23,970 --> 00:06:28,910 So now you can find that no outcome is and because both the conditions are true here. 111 00:06:29,600 --> 00:06:30,890 Next, we are going for the break. 112 00:06:31,280 --> 00:06:32,330 Next queue, what is break. 113 00:06:32,900 --> 00:06:34,190 So in this break, what is happening? 114 00:06:34,190 --> 00:06:37,360 You can find that for I in range one, comma eleven. 115 00:06:37,640 --> 00:06:43,730 So that means I will have their value ranging from one to ten because this one that is a lower limit 116 00:06:43,730 --> 00:06:46,610 will be inclusive and the upper limit will be all is exclusive. 117 00:06:47,090 --> 00:06:48,470 So that's why you are having this. 118 00:06:48,490 --> 00:06:50,960 I should be ranging from one to ten actually. 119 00:06:51,200 --> 00:06:55,280 If you use the range one comma eleven safe icicle divisible to five. 120 00:06:55,310 --> 00:06:55,980 Then break. 121 00:06:56,060 --> 00:07:00,800 That means it will come out from the loop tendency to dominate the loop and it will come on from the 122 00:07:00,800 --> 00:07:01,040 loop. 123 00:07:01,490 --> 00:07:02,300 So how did it happen? 124 00:07:02,860 --> 00:07:05,170 So the alchemy of spring die. 125 00:07:05,360 --> 00:07:08,210 So I will be printed for one, two, three and four. 126 00:07:08,570 --> 00:07:10,640 But here on the icicle to fight. 127 00:07:10,700 --> 00:07:12,260 Then break statement will be executed. 128 00:07:12,290 --> 00:07:12,860 So print. 129 00:07:12,870 --> 00:07:15,020 I will remain unreachable. 130 00:07:15,380 --> 00:07:17,640 Will remain unrestrained on execute it. 131 00:07:17,870 --> 00:07:21,410 So as it is, I wrap that up to one, two, three, four will get printed. 132 00:07:21,860 --> 00:07:26,210 So break will actually dominate the loop and it will come out from the loop here. 133 00:07:27,120 --> 00:07:27,370 Next. 134 00:07:27,400 --> 00:07:33,800 Next we're going to continue in because up until we can find that for I in range one comma eight. 135 00:07:33,890 --> 00:07:36,050 That means I will be ranging from one to seven. 136 00:07:36,500 --> 00:07:37,680 So if I physical. 137 00:07:37,710 --> 00:07:40,880 Physical of five, so on, when the value of I will be five then continue. 138 00:07:41,240 --> 00:07:46,310 That means the next part will remain unexpected, unreachable and continue means to continue with the 139 00:07:46,310 --> 00:07:47,890 loop, with the next value up I. 140 00:07:48,440 --> 00:07:49,290 So what will happen. 141 00:07:49,310 --> 00:07:54,350 One, two, three, four will get printed for five to continue will take place or the content will be 142 00:07:54,350 --> 00:07:56,090 going back to the fourth straight and again. 143 00:07:56,450 --> 00:07:58,550 So next time six and seven will get brain dead. 144 00:07:58,730 --> 00:08:00,620 So five will be missing in the output. 145 00:08:01,550 --> 00:08:02,940 Next we are going for the class. 146 00:08:03,110 --> 00:08:08,450 So let us suppose here we are having one class that is the example Class A class and B containing multiple 147 00:08:08,450 --> 00:08:15,300 variables and multiple member vegetables and member functions, also known as messages and methods respectively. 148 00:08:15,320 --> 00:08:16,790 Here you have defined two methods. 149 00:08:17,210 --> 00:08:18,290 There is a day function. 150 00:08:18,290 --> 00:08:19,130 One parameters. 151 00:08:19,160 --> 00:08:25,920 We shall be passing parameters and then print function, one that is executing def function two parameters. 152 00:08:25,930 --> 00:08:28,190 So print function two is executing. 153 00:08:28,580 --> 00:08:31,510 So now we are creating one object under this class. 154 00:08:31,610 --> 00:08:32,690 That is an example. 155 00:08:32,900 --> 00:08:35,600 So here Claus's a keyword to define a class. 156 00:08:36,050 --> 00:08:38,420 And here the object has been defined under the class. 157 00:08:38,480 --> 00:08:39,530 Example class here. 158 00:08:39,860 --> 00:08:42,710 So we'll be one dark function one and only two drug function. 159 00:08:42,710 --> 00:08:44,090 Two will be called here. 160 00:08:44,390 --> 00:08:47,360 So now if I go for the execution I can find that function. 161 00:08:47,360 --> 00:08:49,600 One executing function to executing. 162 00:08:49,610 --> 00:08:50,600 They're getting printed. 163 00:08:50,870 --> 00:08:56,210 So in this way the class can be different, defined using the keyword class. 164 00:08:58,390 --> 00:09:03,550 In this way, the class declares, and we take this next only we're having this deaf, so deaf will 165 00:09:03,550 --> 00:09:03,940 be used. 166 00:09:03,970 --> 00:09:07,200 Deaf stands for define so deaf will be used by anybody. 167 00:09:07,210 --> 00:09:08,240 We're going to define one. 168 00:09:08,340 --> 00:09:09,400 It was a different function. 169 00:09:10,090 --> 00:09:13,300 So deaf then functioning will becoming then parameters. 170 00:09:13,360 --> 00:09:17,230 And then let us suppose we're having this pass passes nothing but one placeholder. 171 00:09:17,800 --> 00:09:23,520 So if we execute pass then actually no outcome will be opting out but will be obtained. 172 00:09:23,810 --> 00:09:29,740 Boss is actually required in those cases where you were supposed to intern or include some more codes 173 00:09:30,370 --> 00:09:33,280 to add some more functionality to the application. 174 00:09:33,520 --> 00:09:35,470 So that is the use of the POS actually. 175 00:09:35,920 --> 00:09:41,740 So DEF is a keyword with the help which were defining one function and then you can call the function 176 00:09:41,830 --> 00:09:42,250 as well. 177 00:09:42,280 --> 00:09:44,980 So now we can see this particular function we are calling. 178 00:09:45,340 --> 00:09:46,420 So there is one argument. 179 00:09:46,450 --> 00:09:47,990 It is decoding, there is a parameter. 180 00:09:47,990 --> 00:09:50,140 So now let me go for the parameters here. 181 00:09:50,520 --> 00:09:52,150 So I'm passing, say, Satine here. 182 00:09:52,810 --> 00:09:58,930 So there will be no error, but obviously there will be no outcome because POS does not produce any 183 00:09:58,930 --> 00:09:59,500 output here. 184 00:10:00,820 --> 00:10:02,110 Next, we are going for the DL. 185 00:10:02,530 --> 00:10:06,230 So this particular deal you see is equal to 10 print A. 186 00:10:06,310 --> 00:10:09,430 So the value of A has got printed S10 delayed. 187 00:10:09,550 --> 00:10:13,240 That means this eight, this variable will get deleted from the computer's memory. 188 00:10:13,600 --> 00:10:18,260 So next time if I go for printing this E, then one error will be raised. 189 00:10:18,310 --> 00:10:23,970 And that that is known as Nimir because the variable does not exist and isn't written as the message. 190 00:10:23,980 --> 00:10:26,320 That name is not defined here. 191 00:10:26,860 --> 00:10:30,490 Because after deleting the variable A will be D. 192 00:10:30,610 --> 00:10:31,750 Look at it from the memory. 193 00:10:31,900 --> 00:10:35,960 So next time, if you go for print day, it will tell you it will raise that name. 194 00:10:35,960 --> 00:10:36,580 Made it here. 195 00:10:40,520 --> 00:10:41,180 We're having this. 196 00:10:41,240 --> 00:10:47,750 If ayliffe and else numb is the goal to do, if Nahm is the goal, is the goal to one, then print one. 197 00:10:48,350 --> 00:10:54,340 If elopements sexually elusive, but here, in case a python will be writing it as a live e-mail, I-F 198 00:10:54,620 --> 00:10:58,730 all always remember after even after Ayliffe will be writing one condition. 199 00:10:58,750 --> 00:11:03,920 This is a condition where writing after the condition that it be one colon discoloring indicate that 200 00:11:03,950 --> 00:11:05,580 we are starting with the block. 201 00:11:05,970 --> 00:11:09,860 Under this true part of this if statement. 202 00:11:10,250 --> 00:11:14,480 So under this true part where we have kept only one statement, that is a print one. 203 00:11:14,780 --> 00:11:18,170 So it is having one indentation indentation means for blank spaces. 204 00:11:18,200 --> 00:11:20,250 You can find that we are having four blank spaces here. 205 00:11:20,660 --> 00:11:24,980 So that will indicate that this line is having the Fosdick meant with the indentation. 206 00:11:25,580 --> 00:11:31,820 And then we'll be writing this elif with the outer dent without dent you can find that the same indentation 207 00:11:31,820 --> 00:11:33,570 will be maintained for even Elif. 208 00:11:33,860 --> 00:11:37,580 They'll be starting from the same column and none is visible to do. 209 00:11:37,590 --> 00:11:40,310 It will check that the value of NUM is equal to or not. 210 00:11:40,730 --> 00:11:41,570 Then one colon. 211 00:11:41,630 --> 00:11:46,670 So when nobody will give colon and presenter automatically, the castle will be blinking with the new 212 00:11:46,760 --> 00:11:47,330 indent. 213 00:11:48,500 --> 00:11:49,670 So that is a print too. 214 00:11:49,740 --> 00:11:51,950 And else would have been something else. 215 00:11:52,310 --> 00:11:55,790 So did the if Elif and else block anyone else. 216 00:11:55,870 --> 00:11:56,810 They are optional. 217 00:11:56,900 --> 00:11:57,890 If is mandatory. 218 00:11:57,890 --> 00:12:03,800 If we write any conditional block so Elif can oakar for multiple no uptimes also we can have multiple 219 00:12:03,800 --> 00:12:04,140 elif. 220 00:12:04,190 --> 00:12:06,170 So let me go for the execution. 221 00:12:06,170 --> 00:12:07,860 You can find that it is printing too. 222 00:12:08,900 --> 00:12:11,270 If I make it one it is printing one. 223 00:12:11,810 --> 00:12:13,640 If I make it three, it is printing. 224 00:12:15,240 --> 00:12:20,160 Something else, because the because the now musical musical one is not getting through. 225 00:12:20,190 --> 00:12:23,310 Now musical is illegal to do, too, is not getting through. 226 00:12:23,570 --> 00:12:24,940 So it is coming to the spot. 227 00:12:25,260 --> 00:12:26,520 Now, let us suppose I'm putting. 228 00:12:28,290 --> 00:12:31,260 There is always I'm putting under Jack Deck out of the ayliffe. 229 00:12:34,410 --> 00:12:35,810 So now in this way, what will happen? 230 00:12:36,180 --> 00:12:37,220 It is printing three. 231 00:12:37,290 --> 00:12:40,820 But if I make this one for, then it will be going for the LDS part. 232 00:12:41,580 --> 00:12:45,480 So I think now you are getting this idea of what this IEF ayliffe and LDS block. 233 00:12:46,500 --> 00:12:48,870 Next, we're going for this tri res catch. 234 00:12:48,900 --> 00:12:54,180 And finally, so these are the very important keywords such under the try you will be writing so many 235 00:12:54,180 --> 00:12:54,660 statements. 236 00:12:54,750 --> 00:12:58,350 We can try to block where we're expecting some errors may be raised. 237 00:12:58,830 --> 00:13:02,190 So errors may be raised during the calculations of competitions. 238 00:13:02,310 --> 00:13:05,460 Otherwise, we can also raise our error, if adequate, to do so. 239 00:13:05,880 --> 00:13:06,540 He had one error. 240 00:13:06,690 --> 00:13:08,850 We have raised that is a JIRU division error. 241 00:13:09,510 --> 00:13:13,660 So after this, except this Gedo division error has been mentioned. 242 00:13:13,680 --> 00:13:16,920 So you are going to handle the erroneous condition here. 243 00:13:17,550 --> 00:13:20,640 So then these these are respective remedial body. 244 00:13:21,120 --> 00:13:23,330 And then finally, is that very bocian? 245 00:13:23,520 --> 00:13:23,820 That is. 246 00:13:24,180 --> 00:13:25,240 There is a block on that. 247 00:13:25,240 --> 00:13:31,680 The finally it will be executed even if the any error is occurring or if there is no error. 248 00:13:31,710 --> 00:13:34,080 Then also the final block will get executed. 249 00:13:34,110 --> 00:13:35,520 So let me go for the execution. 250 00:13:36,180 --> 00:13:42,120 So division can be part cannot be performed because that the here the res digital division natur has 251 00:13:42,120 --> 00:13:42,870 been raised here. 252 00:13:43,410 --> 00:13:48,000 So but you see the final block is getting executed execution successfully. 253 00:13:48,720 --> 00:13:52,860 So now if we met this one under comment, if you make this one under comment, then what? 254 00:13:52,930 --> 00:13:55,450 We can find that the execution successfully. 255 00:13:55,470 --> 00:13:57,450 This particular statement is getting executed. 256 00:13:57,480 --> 00:14:03,660 That means a finally block will get the control always, irrespective of the fact that any idea has 257 00:14:03,660 --> 00:14:05,040 been raised or not. 258 00:14:05,760 --> 00:14:09,710 We'll be discussing all these aspects in our respective chapters for more detailing. 259 00:14:10,530 --> 00:14:11,670 Let us go four to four. 260 00:14:11,790 --> 00:14:13,310 So these are four is a key word. 261 00:14:13,410 --> 00:14:15,730 So for I in range one, comma ten. 262 00:14:16,110 --> 00:14:18,870 So here disvalue value by you will be ranging from one to nine. 263 00:14:18,930 --> 00:14:24,180 As I told you that the ending limits, the stop Balu will be exclusive. 264 00:14:24,210 --> 00:14:25,330 So here's the value up. 265 00:14:25,350 --> 00:14:29,270 I will be ranging from one to nine, as you didn't mention any step. 266 00:14:29,480 --> 00:14:31,380 So by default, a stable will be one. 267 00:14:31,920 --> 00:14:33,330 So that's why this value up. 268 00:14:33,360 --> 00:14:34,860 I will be increased by one. 269 00:14:34,860 --> 00:14:35,370 By one. 270 00:14:35,670 --> 00:14:36,800 So one come out. 271 00:14:36,920 --> 00:14:42,120 Then technique's one common two common commentary up to the value of ILB ranging up to nine. 272 00:14:42,600 --> 00:14:43,740 So let me go for the print. 273 00:14:43,770 --> 00:14:47,840 You can find that in this way the four is getting executed using this far. 274 00:14:47,850 --> 00:14:49,920 We can go for the iterations and looping. 275 00:14:50,730 --> 00:14:52,770 Next, we are going for this from an import. 276 00:14:52,830 --> 00:14:55,010 Another two very important pair of keywords. 277 00:14:55,410 --> 00:14:56,330 So input, Matt. 278 00:14:56,400 --> 00:14:57,990 That means we're importing one model. 279 00:14:58,080 --> 00:14:59,400 The name of the model is Matt. 280 00:14:59,790 --> 00:15:00,690 And from Matt. 281 00:15:00,700 --> 00:15:01,350 Matt, Matt. 282 00:15:01,400 --> 00:15:03,110 We are importing this cause. 283 00:15:03,600 --> 00:15:06,640 So little we can use this cause as when required. 284 00:15:06,690 --> 00:15:09,280 But there in that case, you need not to apply. 285 00:15:09,310 --> 00:15:11,250 So I'm just writing this one for this print. 286 00:15:12,050 --> 00:15:13,330 Go for cause. 287 00:15:14,460 --> 00:15:16,140 Say I'm going for a 10 here. 288 00:15:16,730 --> 00:15:19,320 So if you go on printing, you can find that it is printing a value. 289 00:15:19,620 --> 00:15:25,560 So here I need not to write metadata cause I need not write because we are written from math import 290 00:15:25,740 --> 00:15:26,190 corsia. 291 00:15:26,340 --> 00:15:28,320 So I can use this cause method. 292 00:15:28,800 --> 00:15:30,840 According to the same test as I option. 293 00:15:31,520 --> 00:15:33,840 Next, we are having the next keyword that is a global. 294 00:15:34,410 --> 00:15:35,230 So here they are defined. 295 00:15:35,370 --> 00:15:40,470 One variable that is that global var there's a read one which will bring the value of this global var 296 00:15:40,890 --> 00:15:41,640 is the right one. 297 00:15:41,670 --> 00:15:45,690 Here you are mentioning the global word as a variable with the keyword global. 298 00:15:46,140 --> 00:15:48,930 So now this global word is getting updated. 299 00:15:49,350 --> 00:15:53,650 Now using the right to we can also changing this global world with 15. 300 00:15:54,330 --> 00:15:59,280 But here you can find that this global global word, this particular statement is missing. 301 00:15:59,550 --> 00:16:01,280 So this now wasn't going to happen. 302 00:16:01,290 --> 00:16:02,730 So let me go for the execution. 303 00:16:03,180 --> 00:16:08,610 See, at first we have all this read one function, so read one will print the global of our value. 304 00:16:08,970 --> 00:16:10,890 And that is 10 or 10 has got printed. 305 00:16:11,490 --> 00:16:13,350 Now we just call the right one function. 306 00:16:13,380 --> 00:16:18,320 So write one function will defined this global var as a variable here within this right. 307 00:16:18,330 --> 00:16:24,540 And this global keyword is actually indicating that this global votizen is not a new variable, but 308 00:16:24,540 --> 00:16:27,120 the symbol which is there as a global variable. 309 00:16:27,510 --> 00:16:29,250 So we are doing that bit on to that. 310 00:16:29,750 --> 00:16:31,020 So next one is a read. 311 00:16:31,170 --> 00:16:33,570 One function is getting exequatur. 312 00:16:33,600 --> 00:16:35,390 So when you are printing this global, what? 313 00:16:35,710 --> 00:16:38,640 We are not getting distend, but we are getting this updated value. 314 00:16:38,660 --> 00:16:39,510 That is five here. 315 00:16:40,040 --> 00:16:44,850 In case of now, we are calling this right to increase a right to see the global global word. 316 00:16:44,910 --> 00:16:46,170 That statement is missing. 317 00:16:46,490 --> 00:16:48,070 But I think this global over 15. 318 00:16:48,120 --> 00:16:49,080 So what is happening? 319 00:16:49,380 --> 00:16:53,760 This global void is might be having the same name name as that of the global variable. 320 00:16:53,880 --> 00:16:57,030 But as we didn't write global global var here. 321 00:16:57,240 --> 00:17:02,040 So that's why this global effort is working as a local variable within the right to method. 322 00:17:02,430 --> 00:17:04,200 So now what about the bits we're doing. 323 00:17:04,290 --> 00:17:07,680 That's a desktop is confined within this right to method. 324 00:17:08,070 --> 00:17:10,230 So this global var when it will get printed. 325 00:17:10,530 --> 00:17:12,540 I'm going to print the five again. 326 00:17:12,540 --> 00:17:16,110 Not fit in here because we have Gwynfor the read one at the last. 327 00:17:16,500 --> 00:17:20,820 So in this way you can see that in this called how the global keyword has been used. 328 00:17:22,070 --> 00:17:25,880 We're having this in so in actually use for the membership. 329 00:17:26,300 --> 00:17:31,310 So here you have defined one least the least will be enclosed within the square brackets in our in our 330 00:17:31,320 --> 00:17:31,680 python. 331 00:17:32,210 --> 00:17:33,680 So four in a. 332 00:17:33,740 --> 00:17:37,790 So now it is checking with the four is a is a member of this list or not. 333 00:17:38,110 --> 00:17:39,250 So it is producing the output. 334 00:17:39,380 --> 00:17:39,670 True. 335 00:17:40,220 --> 00:17:47,780 But if you write the same say print, say 44 in a then obviously it will produce outcome as false. 336 00:17:49,100 --> 00:17:50,240 So that is a what in. 337 00:17:50,390 --> 00:17:51,950 And also we can go for the not in. 338 00:17:52,130 --> 00:17:53,410 You can also go for the Nourredine. 339 00:17:53,500 --> 00:17:54,320 You can find that. 340 00:17:58,190 --> 00:18:03,350 So for not being a is false and 44 not being a is true. 341 00:18:04,490 --> 00:18:08,570 Next one you are going for, this is so print, true is true. 342 00:18:08,600 --> 00:18:09,830 So easy is a keyword. 343 00:18:09,950 --> 00:18:13,800 So its outcome is true here to define anonymous functions. 344 00:18:13,880 --> 00:18:17,200 That is, it was a different functions, but no name without any name. 345 00:18:17,520 --> 00:18:22,130 We're using the key word lambda for anybody with defined use that event function with a name. 346 00:18:22,190 --> 00:18:25,190 We are using the Q what Def Def stands for define. 347 00:18:25,760 --> 00:18:30,320 But in case of anonymous function anonymous method the keyword will be lambda. 348 00:18:30,830 --> 00:18:32,030 So here to see lambda. 349 00:18:32,240 --> 00:18:33,920 So the function has got no name. 350 00:18:34,190 --> 00:18:39,980 It will take this X as input argument and it returns it to it does a calculation that is X start to 351 00:18:40,080 --> 00:18:44,860 that is two times it will multiply this value of X and that will be assigned to a. 352 00:18:45,320 --> 00:18:47,960 So far I in range one comma six. 353 00:18:47,980 --> 00:18:50,780 So that means I will be ranging from one to five. 354 00:18:51,110 --> 00:18:53,900 And it is printing i e i. 355 00:18:53,960 --> 00:18:55,660 That means this I will be passed. 356 00:18:55,970 --> 00:19:00,980 That means at first the value of I will be one, then two, then three, then four, then five. 357 00:19:01,490 --> 00:19:03,380 And this I'll be passed to this method. 358 00:19:03,410 --> 00:19:06,000 And he does returning that to into X. 359 00:19:06,260 --> 00:19:07,670 So two into Y you will be returned. 360 00:19:07,700 --> 00:19:09,570 So I'm going to get insert one. 361 00:19:09,620 --> 00:19:10,680 I shall be getting two. 362 00:19:11,000 --> 00:19:13,850 When the value of I'll be two, I shall be getting four. 363 00:19:14,090 --> 00:19:15,560 And the value of I will be five. 364 00:19:15,620 --> 00:19:17,360 I shall be getting ten here. 365 00:19:17,570 --> 00:19:20,570 So I can also being developed by the better understanding. 366 00:19:22,630 --> 00:19:24,130 Next week, Gwynfor, the nonlocal. 367 00:19:25,750 --> 00:19:30,580 So these outer function, we're having this variable, a physical to fight, these are inner function 368 00:19:30,940 --> 00:19:33,640 here to have defined this one as nonlocal a.. 369 00:19:34,180 --> 00:19:39,880 And now we are just operating the value up A and from the inner function, we are printing the value 370 00:19:39,880 --> 00:19:42,550 up eight from the outer function. 371 00:19:42,670 --> 00:19:44,080 Inner function has been defined. 372 00:19:44,140 --> 00:19:46,090 So now we can call the inner function. 373 00:19:46,480 --> 00:19:51,150 And then from the outer function scope, we are printing the outer function eight. 374 00:19:51,550 --> 00:19:54,700 So now we're calling this outer function, using this statement. 375 00:19:55,120 --> 00:20:01,200 So we can find that inner function has got assigned ten to eight because he is nonlocal eight. 376 00:20:01,210 --> 00:20:03,010 That means this is nonlocal. 377 00:20:03,020 --> 00:20:06,790 That means that there is not locally within this inner function. 378 00:20:06,820 --> 00:20:08,130 That is when using this, eh. 379 00:20:08,580 --> 00:20:11,280 And when nobody was doing some uplift and went about it. 380 00:20:11,280 --> 00:20:12,280 We are printing this one. 381 00:20:12,340 --> 00:20:13,230 I'm getting here 10. 382 00:20:13,630 --> 00:20:18,100 And from the outer function on see if you print this A I shall be getting ten back here. 383 00:20:18,490 --> 00:20:20,950 So here you are discussing the Q word. 384 00:20:21,070 --> 00:20:22,340 That is a non local. 385 00:20:23,130 --> 00:20:24,030 We're having the key word. 386 00:20:24,040 --> 00:20:27,100 That is a pass which are which are discussed already. 387 00:20:27,550 --> 00:20:29,400 So boss will have no outcome. 388 00:20:29,400 --> 00:20:30,070 You can see that. 389 00:20:30,340 --> 00:20:35,950 I run that code, but no outcome has been planned because POS is actually working as a placeholder. 390 00:20:36,310 --> 00:20:42,100 So in future, under this function function, if I want to add more functionalities, if I want to add 391 00:20:42,100 --> 00:20:48,100 more codes and statements, in that case, I can do this POS because plastic passes nothing but one 392 00:20:48,100 --> 00:20:50,830 placeholder letter for new code insertion. 393 00:20:50,950 --> 00:20:53,660 I can replace POS with the new set up codes. 394 00:20:53,920 --> 00:20:56,560 So that's why you see it is producing no outcome. 395 00:20:57,010 --> 00:20:58,400 So let me call the functional so. 396 00:21:01,210 --> 00:21:04,820 Sam, passing distend is he is producing no outcome here. 397 00:21:05,450 --> 00:21:11,250 Next, we're having this return returnee's, another very important QAD so easy Golu 10 within dysfunction. 398 00:21:11,540 --> 00:21:14,330 The bodies asal 210 and written eight. 399 00:21:14,810 --> 00:21:19,280 So now whenever we are calling this function, the function will return the value apaid. 400 00:21:19,340 --> 00:21:19,920 That is 10. 401 00:21:20,240 --> 00:21:21,550 And we are printing that value here. 402 00:21:21,590 --> 00:21:23,270 So now let Bingel for the execution. 403 00:21:23,300 --> 00:21:24,230 I'm getting 10 here. 404 00:21:24,950 --> 00:21:32,040 So now we are having this while so indicus i while I all the five I agree that then zero I print, I 405 00:21:32,040 --> 00:21:34,140 add Isaac Icicle to a minus one. 406 00:21:34,160 --> 00:21:36,750 So I've written this one as a minus equal to one. 407 00:21:37,370 --> 00:21:39,440 So value of I'll go on printing. 408 00:21:39,560 --> 00:21:44,600 And this process will be continued when the value up I'll be good at Angelo. 409 00:21:44,720 --> 00:21:47,840 So if they execute my code I'll be getting the output for Isaac. 410 00:21:47,840 --> 00:21:50,640 I'll do five, four, three, two and one. 411 00:21:51,860 --> 00:21:52,080 OK. 412 00:21:52,190 --> 00:21:53,720 The next keyword is with. 413 00:21:54,110 --> 00:21:58,430 So with open example dxp w as my file. 414 00:21:58,850 --> 00:22:00,020 So now what will happen. 415 00:22:00,230 --> 00:22:04,130 This exam will go to 60, will be opened in the right mode. 416 00:22:04,460 --> 00:22:06,590 And here that we're using the Q word with. 417 00:22:06,960 --> 00:22:12,990 And to that particular file pointed to this particular file reference where you calling this write method. 418 00:22:13,250 --> 00:22:17,120 And this particular string will get printed onto that example, dark DST. 419 00:22:17,780 --> 00:22:21,900 So now if I go for execution, you can find that the examples are dxp there. 420 00:22:21,950 --> 00:22:25,550 So let me go for the checking example. 421 00:22:25,550 --> 00:22:32,440 The text has been created just a seconds ago and you can find that is body is having only one string. 422 00:22:32,450 --> 00:22:35,660 That is a HelloWallet which you printed here, which you printed here. 423 00:22:36,260 --> 00:22:42,350 So this way we using this with keyword, we can open a file either in the read mode or in the right 424 00:22:42,350 --> 00:22:43,730 mode or in the app in mode. 425 00:22:44,240 --> 00:22:47,420 And we're having a separate section where you discuss that. 426 00:22:47,420 --> 00:22:49,010 What are the different modes? 427 00:22:49,010 --> 00:22:52,400 Are possible land operations are possible on about data files. 428 00:22:53,180 --> 00:22:55,360 So this is a use of that with keyword. 429 00:22:55,630 --> 00:22:56,750 We're having the field. 430 00:22:56,860 --> 00:22:59,350 That is another very important word in our generator. 431 00:23:00,260 --> 00:23:02,360 So, David, generator, we have defined one method. 432 00:23:02,360 --> 00:23:03,960 The name of the method is generator. 433 00:23:04,010 --> 00:23:06,190 And for I in range six. 434 00:23:06,230 --> 00:23:07,840 That means he had this value up. 435 00:23:07,850 --> 00:23:11,400 I will be ranging from Jiru to five six minutes. 436 00:23:11,420 --> 00:23:13,790 The value will be ranging from Dutra to fight. 437 00:23:14,270 --> 00:23:16,410 And here we are not returning anything, is he? 438 00:23:16,610 --> 00:23:19,250 In case of genitive function, we don't have the written statement. 439 00:23:19,490 --> 00:23:21,080 We usually have the error statement. 440 00:23:21,440 --> 00:23:25,100 Yield will go on accumulating all the calculated values. 441 00:23:25,160 --> 00:23:26,120 So what is the value here? 442 00:23:26,420 --> 00:23:29,750 I start I, I will be the engine from zero to five. 443 00:23:30,050 --> 00:23:32,210 So I'm going for the square up that I. 444 00:23:32,390 --> 00:23:37,170 So it will be having the value zero one four nine 16 and five squared. 445 00:23:37,190 --> 00:23:37,990 That is twenty five. 446 00:23:38,540 --> 00:23:41,060 So now it will return one iterator. 447 00:23:41,090 --> 00:23:45,110 So now generator the outcome will be, will be Opt-In in G. 448 00:23:45,320 --> 00:23:48,090 And then from four I n g. 449 00:23:48,230 --> 00:23:52,610 I shall go on printing the value of pi and the respective outcome will be operand here. 450 00:23:53,030 --> 00:23:54,870 So instead of having that return. 451 00:23:55,100 --> 00:24:00,410 In case of genitive functions will be having the key word ealand which will go on accumulating all the 452 00:24:00,620 --> 00:24:03,830 calculated values and letter from this iterator. 453 00:24:03,880 --> 00:24:09,530 We can using the for loop, we can pick up each and every element at a time in one loop, in one iteration 454 00:24:09,860 --> 00:24:11,470 and go on doing the competitions. 455 00:24:11,510 --> 00:24:14,670 But here you have just printed the value of AI here. 456 00:24:15,290 --> 00:24:19,520 So in this particular example, we have discussed multiple different keywords. 457 00:24:19,580 --> 00:24:22,040 You can see that so many different keywords you have defined. 458 00:24:22,460 --> 00:24:24,770 Other than these other key words are also available. 459 00:24:25,040 --> 00:24:30,110 But these are the most usable and frequently used keywords in our python code. 460 00:24:30,980 --> 00:24:38,510 And on them, we have written small example codes and we have explained that one with the required outputs. 461 00:24:39,020 --> 00:24:40,190 Thanks for watching this video.