1 00:00:00,490 --> 00:00:05,500 Here in this video, we are going to discuss Biton keywords and identifiers. 2 00:00:07,480 --> 00:00:13,780 So we're starting with the python keywords, so keywords at the of words in Python, like any other 3 00:00:13,780 --> 00:00:18,000 programming languages, Python has got multiple different keywords. 4 00:00:18,430 --> 00:00:25,750 So during coding, key words can be used as a variable name and function name or any other identified 5 00:00:26,080 --> 00:00:29,410 that this keywords are reserved for the keyword purposes only. 6 00:00:29,410 --> 00:00:36,160 They cannot be used as a variable name or identifier or function, name, model and so on. 7 00:00:36,430 --> 00:00:38,720 So that's why these keywords are reserved for them. 8 00:00:39,610 --> 00:00:45,860 So they are they are used to define the syntax and the structure of the python language. 9 00:00:46,240 --> 00:00:53,370 So in our python drill, we'll be using almost all keywords in different sections has when required. 10 00:00:53,860 --> 00:00:56,740 So keywords are darkest, sensitive in Python. 11 00:00:58,000 --> 00:01:04,030 So at least this is this is the list of different keywords available, and you can find that here. 12 00:01:04,060 --> 00:01:06,120 We're having 33 keywords. 13 00:01:06,430 --> 00:01:09,070 So one, two, three, four, five columns there. 14 00:01:09,220 --> 00:01:13,040 And one, two, three, four, five, six, seven are there. 15 00:01:13,330 --> 00:01:15,610 So here we are having 33 keywords. 16 00:01:15,820 --> 00:01:22,900 And all the keywords will be discussed in the next videos has been required because they without them, 17 00:01:22,900 --> 00:01:24,130 we cannot write our code. 18 00:01:25,380 --> 00:01:33,120 Let us discuss Biton identifiers, so Python identifiers is nothing but the names given to the entities 19 00:01:33,240 --> 00:01:39,840 like your class functions, variables, etc, so that's where they will be known as the identifiers 20 00:01:39,930 --> 00:01:46,660 and they will be used to name a class to name available to name a function in Python. 21 00:01:47,070 --> 00:01:51,470 It helps us in differentiating one entity from another entity. 22 00:01:51,480 --> 00:01:56,290 So that's why all the function names should be distinct, all the variable names should be distinct. 23 00:01:56,890 --> 00:02:03,750 So rules for writing identifiers so identifiers can be a combination of letters in the lowercase or 24 00:02:03,750 --> 00:02:10,940 in the uppercase letters that is capital A to capital Z at digits ranging from zero to nine or an underscore 25 00:02:10,950 --> 00:02:11,710 like this one. 26 00:02:11,910 --> 00:02:16,050 So these are the valid characters in our identifiers. 27 00:02:17,370 --> 00:02:24,870 Names like the MIT Class one, underscore two and display underscore two on the screen. 28 00:02:25,020 --> 00:02:29,610 So these are all the valid examples of these identifiers. 29 00:02:30,180 --> 00:02:32,680 So I did the Fergana start with the digit. 30 00:02:33,330 --> 00:02:35,880 So one variable is not valid. 31 00:02:35,880 --> 00:02:40,860 It is invalid, but variable one can be treated as a valid identifier. 32 00:02:42,130 --> 00:02:49,600 Key words cannot be used as identifiers, we cannot use special symbols like exclamation at the rate 33 00:02:49,600 --> 00:02:54,870 of hash, percentage symbols, etc. in our identifier name. 34 00:02:55,180 --> 00:02:58,930 So these rules are mostly common in almost all programming languages. 35 00:02:59,110 --> 00:03:03,830 But in Python, these are the rules to be followed while defining identifiers. 36 00:03:04,180 --> 00:03:07,330 So let us go for some demonstration for the better understanding. 37 00:03:08,260 --> 00:03:13,660 Britain is having multiple different keywords here in this demonstration, we shall discuss some of 38 00:03:13,660 --> 00:03:13,960 them. 39 00:03:14,440 --> 00:03:17,330 The first we are going to discuss that is true and false. 40 00:03:17,350 --> 00:03:22,770 Remember, too, is starting with the capital city and rest of the leaders will be in the lower case 41 00:03:22,780 --> 00:03:27,400 and in case of also the same uppercase and lowercase syntax will be maintained. 42 00:03:27,940 --> 00:03:31,590 So here we are having five equal to equal to five and five. 43 00:03:31,600 --> 00:03:31,760 Good. 44 00:03:31,780 --> 00:03:35,600 And then you can find that we are getting the outcome as true and false. 45 00:03:35,620 --> 00:03:37,420 So here the true and false are nothing. 46 00:03:37,420 --> 00:03:43,620 But the key words in Britain are going to have the next one that is of a none so nonphysical. 47 00:03:44,290 --> 00:03:45,600 Now let me go for the outcome. 48 00:03:46,120 --> 00:03:48,370 So it is producing the output is true. 49 00:03:48,370 --> 00:03:55,810 That is Nonis, not Giteau Nonis Nautical the false Nonis not like an empty list and nonphysical is 50 00:03:55,810 --> 00:03:56,350 going on. 51 00:03:56,350 --> 00:04:00,230 It is returning me that to know what is the use of non actually. 52 00:04:00,280 --> 00:04:02,190 So let me go for this here too. 53 00:04:02,200 --> 00:04:03,310 I do find one function. 54 00:04:03,310 --> 00:04:07,090 The name of the function is a void function because it is void, right. 55 00:04:07,090 --> 00:04:09,100 Because it does not return any value. 56 00:04:09,580 --> 00:04:16,420 So now if we the return, if we assign to X and if we then print X then obviously we shall get the non 57 00:04:16,420 --> 00:04:17,290 as the outcome. 58 00:04:17,290 --> 00:04:21,280 You can find that we are getting none but here if the function returns. 59 00:04:24,530 --> 00:04:30,830 They find that it is returning the value see value of these three hit and three is getting printed. 60 00:04:30,860 --> 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 61 00:04:36,230 --> 00:04:38,660 because the function returns none. 62 00:04:40,190 --> 00:04:46,130 Next one is the end or and not so true and true, true and true outcome will be true and true outcome 63 00:04:46,130 --> 00:04:47,660 will be true and false. 64 00:04:47,780 --> 00:04:51,140 That outcome will be false, true or false. 65 00:04:51,140 --> 00:04:55,350 The outcome will be true and not a false outcome will be true here. 66 00:04:55,880 --> 00:04:57,950 So in this way, you can go for other combinations. 67 00:04:57,950 --> 00:05:00,430 So let me write some other combinations here. 68 00:05:03,330 --> 00:05:05,280 So let us suppose I'm going for true and true. 69 00:05:07,830 --> 00:05:10,700 I'm going for a true false. 70 00:05:10,920 --> 00:05:15,330 So here we're having this true or true, and if you go for the truth here. 71 00:05:16,570 --> 00:05:23,230 So let me check, what is the outcome we are going to get so true and true is true, true or true is 72 00:05:23,410 --> 00:05:25,930 true and not true is false here. 73 00:05:25,940 --> 00:05:28,740 So there is another way to get the outcome. 74 00:05:28,750 --> 00:05:32,720 And here to discuss that is the and or and not keywords. 75 00:05:33,520 --> 00:05:38,660 Now, we are going to have this as so important, Matt, as my Matt. 76 00:05:38,740 --> 00:05:41,970 So here we are having this ileus of this model, Matt. 77 00:05:42,250 --> 00:05:47,680 So here the key word, as has been used and in the rest of the code will be using my Matt, not the 78 00:05:47,680 --> 00:05:52,660 math here, because Matt has got this model has got renamed to my Matt in this application. 79 00:05:52,930 --> 00:05:57,190 So my metadata calls my metadata by in this way, you can go for the output. 80 00:05:58,490 --> 00:06:05,510 Next one is Assad after Assad using the right one booleans statement, so five, Géraldine five, it 81 00:06:05,510 --> 00:06:07,150 is producing assassinator. 82 00:06:07,550 --> 00:06:10,570 So that's why it had some Assad is taking place. 83 00:06:10,580 --> 00:06:16,760 But if you're right, fibular danford so often Assad, those who write you should write some exhibition 84 00:06:16,760 --> 00:06:19,220 who will return some boolean output. 85 00:06:19,220 --> 00:06:19,760 That is a too. 86 00:06:19,760 --> 00:06:22,880 And also some condition has to be written after Assad. 87 00:06:23,150 --> 00:06:23,930 After Assad. 88 00:06:23,960 --> 00:06:28,920 So now you can find that no outcome is option because both the conditions are true here. 89 00:06:29,540 --> 00:06:32,330 Next, we are going for the break, next QAD break. 90 00:06:32,870 --> 00:06:34,190 So in this break, what is happening? 91 00:06:34,200 --> 00:06:37,360 You can find that for I in range one 11. 92 00:06:37,550 --> 00:06:43,850 So that means I will have value ranging from one to 10 because this one there is a lower limit will 93 00:06:43,850 --> 00:06:46,620 be inclusive and the upper limit will be always exclusive. 94 00:06:47,030 --> 00:06:48,470 So that's why we are having this. 95 00:06:48,470 --> 00:06:52,990 I will be ranging from one to 10 actually if you use range one comma 11. 96 00:06:53,390 --> 00:06:56,000 So if I is is going to fight, then break. 97 00:06:56,030 --> 00:06:58,190 That means it will come out from the loop. 98 00:06:58,190 --> 00:07:01,050 That means it will dominate the loop and it will come out from the loop. 99 00:07:01,430 --> 00:07:02,300 So what will happen? 100 00:07:02,810 --> 00:07:05,030 So the outcome is sprint. 101 00:07:05,330 --> 00:07:08,230 So I will be printed for one, two, three and four. 102 00:07:08,480 --> 00:07:12,280 But here when the eye is equal to fight, then Brigstock will be executed. 103 00:07:12,290 --> 00:07:17,650 So print right will remain unreachable, will remain unreasoned and execute it. 104 00:07:17,810 --> 00:07:21,440 So as a result of that, up to one, two, three, four, it will get printed. 105 00:07:21,830 --> 00:07:27,360 So Brick will actually dominate the loop and it will come out from the loop here next. 106 00:07:27,380 --> 00:07:33,320 Next, we're going to continue in because I want to know you can find that for I in range one, comma 107 00:07:33,410 --> 00:07:36,050 eight, that means I will be ranging from one to seven. 108 00:07:36,440 --> 00:07:42,160 So if I is equal to five, so when the value of I will be five, then continue that with the next part 109 00:07:42,170 --> 00:07:47,780 will remain on executed unbreachable and continue to continue with the loop with the next value up. 110 00:07:48,380 --> 00:07:49,310 So what will happen. 111 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 112 00:07:54,350 --> 00:07:56,120 going back to the fourth statement again. 113 00:07:56,390 --> 00:07:58,570 So next time six and seven will get printed. 114 00:07:58,670 --> 00:08:01,730 So five will be missing in the next. 115 00:08:01,790 --> 00:08:03,010 We are going for the class. 116 00:08:03,020 --> 00:08:08,450 So let us suppose here we are having one class that is the example Class A class will B containing multiple 117 00:08:08,450 --> 00:08:15,320 variables and multiple member variables and member functions, also known as messages and methods respectively. 118 00:08:15,320 --> 00:08:16,780 Here we defined two methods. 119 00:08:17,150 --> 00:08:19,160 There is a function, one parameters. 120 00:08:19,160 --> 00:08:26,080 We shall be passing parameters and then print function, one that is executing their function to parameters 121 00:08:26,090 --> 00:08:27,050 of brain function. 122 00:08:27,050 --> 00:08:28,210 Two is executing. 123 00:08:28,550 --> 00:08:32,680 So now we are creating one object under this class that is an example. 124 00:08:32,840 --> 00:08:35,570 So here is a key word to define a class. 125 00:08:35,930 --> 00:08:39,590 And here the object has been defined under the class example class it. 126 00:08:39,830 --> 00:08:42,080 So it will be one but function one and it will be two. 127 00:08:42,080 --> 00:08:44,110 That function two will be called here. 128 00:08:44,330 --> 00:08:49,880 So now if I go for the execution, I can find that function, one executing function to executing their 129 00:08:49,880 --> 00:08:50,620 getting printed. 130 00:08:50,840 --> 00:08:56,180 So in this way the class can be defined using the keyword class. 131 00:08:58,270 --> 00:09:04,270 In this way, the class declaration will take this next year, having this deaf, so deaf will be deaf, 132 00:09:04,270 --> 00:09:08,370 stands for defined, so deaf will be used whenever we're going to define one. 133 00:09:08,380 --> 00:09:14,140 It was a different function, so deaf then functioning will be coming, then parameters and then, let 134 00:09:14,140 --> 00:09:17,260 us suppose, are having these past passes nothing but one placeholder. 135 00:09:17,740 --> 00:09:23,160 So if we execute past then actually I know outcome will be opting for Puddleby. 136 00:09:23,170 --> 00:09:29,710 Our boss is actually required in those cases where we are supposed to enter or include some more codes 137 00:09:30,370 --> 00:09:33,270 to add some more functionality to the application. 138 00:09:33,490 --> 00:09:35,440 So that is the use of the pass actually. 139 00:09:35,890 --> 00:09:41,770 So DEF is a key word with the help which were defining one function, and then you can call the function 140 00:09:41,770 --> 00:09:42,280 as well. 141 00:09:42,310 --> 00:09:45,000 So now you can see this particular function we are calling. 142 00:09:45,310 --> 00:09:46,450 So that is one argument. 143 00:09:46,450 --> 00:09:47,050 It is decoding. 144 00:09:47,050 --> 00:09:48,010 There is a parameter. 145 00:09:48,010 --> 00:09:50,200 So now let me go for the parameters here. 146 00:09:50,500 --> 00:09:57,580 So I'm passing setin here so there will be no error, but obviously there will be no outcome because 147 00:09:57,580 --> 00:09:59,510 past does not produce any output here. 148 00:10:00,730 --> 00:10:02,070 Next, we are going for the delay. 149 00:10:02,470 --> 00:10:05,980 So this particular deal you see a is 210 print. 150 00:10:06,310 --> 00:10:09,580 So the value of it has got printed as then delayed. 151 00:10:09,580 --> 00:10:13,210 That means this aid is variable will get deleted from the computer's memory. 152 00:10:13,570 --> 00:10:19,540 So next time if I go for printing this E, then one error will be raised and that error is known as 153 00:10:19,690 --> 00:10:23,980 nimura because the variable does not exist and is written as the message. 154 00:10:23,980 --> 00:10:31,790 That name is not defined here because after deleting the variable, A will be allocated from the memory. 155 00:10:31,810 --> 00:10:36,580 So next time if we go for print, it will tell you it will raise the name error here. 156 00:10:40,430 --> 00:10:48,680 We're having this, if live and else nonmusical do, too, if nothing is done, then print one ayliffe 157 00:10:48,720 --> 00:10:55,220 elopements actually elusive but here in case a python will be writing it as ayliffe, if I've always 158 00:10:55,230 --> 00:10:58,760 remembered after event after Ayliffe will be writing one condition. 159 00:10:58,790 --> 00:11:03,950 This a condition where writing after the condition that it be one colon, this conolan indicate that 160 00:11:03,950 --> 00:11:09,860 we are starting with the block and that this true part of this if statement. 161 00:11:10,190 --> 00:11:14,500 So under this true part where we have kept only one statement, that is a print one. 162 00:11:14,750 --> 00:11:16,370 So it is having one indentation. 163 00:11:16,370 --> 00:11:20,300 Indentation means for blank spaces, you can find that we are having four blank spaces here. 164 00:11:20,630 --> 00:11:26,120 So that will indicate that this line is having the first statement with the indentation and then will 165 00:11:26,120 --> 00:11:29,470 be writing this elif with the outer dent without. 166 00:11:29,510 --> 00:11:34,640 Then you can find that the same indentation will be maintained for even Elif they'll be starting from 167 00:11:34,640 --> 00:11:40,910 the same column and now is difficult to do it logical that the value of NUM is equal to two or not then 168 00:11:40,910 --> 00:11:44,450 one colon so nobody will give colon and presented automatically. 169 00:11:44,450 --> 00:11:47,330 The castle will be blinking with the new indent. 170 00:11:48,440 --> 00:11:51,910 So there is a print and ls it having something else. 171 00:11:52,280 --> 00:11:56,840 So this is the if Elif and L's block anyone else, they are optional. 172 00:11:56,840 --> 00:12:02,510 If it's mandatory, if we write any conditional block so elif can occur for multiple number of times. 173 00:12:02,510 --> 00:12:06,200 Also we can have multiple elif so let me go for the execution. 174 00:12:06,200 --> 00:12:07,880 You can find that it is printing too. 175 00:12:08,810 --> 00:12:11,240 If I make it one it is printing one. 176 00:12:11,720 --> 00:12:13,670 If I make it three, it is printing. 177 00:12:15,210 --> 00:12:21,820 Something else, because because nonmusical is a good one, is not getting through, nonmusical is to 178 00:12:21,990 --> 00:12:23,260 do is not getting through. 179 00:12:23,520 --> 00:12:24,950 So it is coming to the spot. 180 00:12:25,200 --> 00:12:26,520 Now, let us suppose I am putting. 181 00:12:28,310 --> 00:12:31,260 US, suppose I'm putting another check that means out of the ayliffe. 182 00:12:34,350 --> 00:12:39,580 So now in this way, what will happen, it is printing three, but if I make this one four, then it 183 00:12:39,600 --> 00:12:40,850 will be going for the eighth spot. 184 00:12:41,550 --> 00:12:47,430 So I think now you are getting this idea of what is ayliffe and else block next week going for this 185 00:12:47,430 --> 00:12:48,900 dry race catch. 186 00:12:48,900 --> 00:12:54,750 And finally, so these are the very important keywords that under the try will be writing so many statements 187 00:12:54,750 --> 00:12:56,760 we can try to block what we are expecting. 188 00:12:56,760 --> 00:13:02,220 Some errors may be erased, so errors may be raised during the calculations or competitions. 189 00:13:02,220 --> 00:13:05,420 Others we can also raise our error if adequate, to do so. 190 00:13:05,820 --> 00:13:08,830 He had one error we have raised that is a jiru deviation error. 191 00:13:09,450 --> 00:13:13,670 So after this, except this division error has been mentioned. 192 00:13:13,680 --> 00:13:16,940 So you are going to handle the erroneous condition here. 193 00:13:17,490 --> 00:13:20,630 So then these are these are respective remedial body. 194 00:13:21,000 --> 00:13:26,700 And then finally, is that the portion that is that there is a block under the finally will be executed, 195 00:13:26,700 --> 00:13:34,020 even if the initiator is orcharding or if there is no error, then also the final block will get executed. 196 00:13:34,110 --> 00:13:40,740 So let me go for the execution so division can be cannot be performed because they to hear the res digital 197 00:13:40,740 --> 00:13:42,900 division, it has been raised here. 198 00:13:43,230 --> 00:13:48,020 So but you see the final block is getting executed execution successfully. 199 00:13:48,660 --> 00:13:53,670 So now if we make this one under comment, if we make this one under comment, then I can find that 200 00:13:54,000 --> 00:13:57,460 the execution successfully, this particular statement is getting executed. 201 00:13:57,480 --> 00:14:03,660 That means the final block will get the control always, irrespective of the fact that any error has 202 00:14:03,660 --> 00:14:08,820 been raised or not, will be discussing all these aspects in our respective chapters. 203 00:14:08,820 --> 00:14:11,660 For more detail, let us go four to four. 204 00:14:11,730 --> 00:14:13,420 So these are the key words. 205 00:14:13,420 --> 00:14:15,750 So for I in range one, comma ten. 206 00:14:16,050 --> 00:14:17,070 So here this is valuable. 207 00:14:17,070 --> 00:14:18,900 I will be ranging from one to nine. 208 00:14:18,900 --> 00:14:24,210 As I told you that the ending limits, the stop will be exclusive. 209 00:14:24,210 --> 00:14:25,350 So here's the follow up. 210 00:14:25,350 --> 00:14:31,380 I will be ranging from one to nine, as you didn't mention any stipple also by default will be one. 211 00:14:31,860 --> 00:14:35,370 So that's why this value will be increased by one by one. 212 00:14:35,610 --> 00:14:40,800 So one comma then that means one comma, two or three up to develop. 213 00:14:40,800 --> 00:14:42,150 I'll be ranging up to nine. 214 00:14:42,540 --> 00:14:43,770 So let me go for the print. 215 00:14:43,770 --> 00:14:45,240 You can find that in this way. 216 00:14:45,240 --> 00:14:47,850 The fourth is getting executed using this far. 217 00:14:47,850 --> 00:14:50,840 We can go for the iterations and looping next. 218 00:14:50,940 --> 00:14:55,050 We are going for this from an import, another two very important pair of key words. 219 00:14:55,350 --> 00:14:58,050 So import math, that means we're importing one module. 220 00:14:58,050 --> 00:15:04,260 The name of the module is Esmat and from Matt we are importing this costs so little. 221 00:15:04,260 --> 00:15:06,690 We can use this cause as when required. 222 00:15:06,690 --> 00:15:09,290 But there in that case, we need not to apply. 223 00:15:09,300 --> 00:15:11,280 So I'm just writing this one for this print. 224 00:15:12,390 --> 00:15:13,320 Go for cause. 225 00:15:14,430 --> 00:15:16,200 Say I'm going for the ten here. 226 00:15:16,680 --> 00:15:19,320 So if you're going printing, you can find that it is printing a value. 227 00:15:19,560 --> 00:15:25,590 So here I need not to write metadata cause I need not write because we have written from math import 228 00:15:25,710 --> 00:15:32,220 cause here so I can use this course method according to the syntax as I have shown next, we are having 229 00:15:32,220 --> 00:15:32,970 the next key word. 230 00:15:32,970 --> 00:15:33,830 There is a global. 231 00:15:34,380 --> 00:15:37,130 So here they will define one variable that is a global FA. 232 00:15:37,500 --> 00:15:40,530 These are read one which will print the value of this global war. 233 00:15:40,800 --> 00:15:41,890 There's a right one here. 234 00:15:41,890 --> 00:15:45,680 You are mentioning the global word as a variable with the key word global. 235 00:15:46,080 --> 00:15:48,930 So now this global word is getting updated. 236 00:15:49,290 --> 00:15:53,700 Now using the right tool, we can also changing this global world with fifteen. 237 00:15:54,270 --> 00:15:59,290 But here you can find that this global global for this particular statement is missing. 238 00:15:59,490 --> 00:16:01,270 So this now what's going to happen? 239 00:16:01,290 --> 00:16:02,730 So let me go for the execution. 240 00:16:03,120 --> 00:16:09,390 See, at first we call this ridwan one function, so ridwan will bring the global value and that is 241 00:16:09,660 --> 00:16:10,910 so ten has got printed. 242 00:16:11,430 --> 00:16:13,380 Now it is called the right one function. 243 00:16:13,380 --> 00:16:18,330 So write one function will define this global for as a variable here within this right. 244 00:16:18,330 --> 00:16:24,570 And this global keyword is actually indicating that this global terrorism is not a new variable, but 245 00:16:24,570 --> 00:16:27,150 the same variable which is there as a global variable. 246 00:16:27,450 --> 00:16:29,240 So we are doing the bit on to that. 247 00:16:29,700 --> 00:16:33,560 So next one is a read, one function is getting executed. 248 00:16:33,600 --> 00:16:38,460 So when you are presenting this global effort, we are not getting the but we are getting this updated 249 00:16:38,460 --> 00:16:38,670 value. 250 00:16:38,670 --> 00:16:44,670 That is five here in case of now we are calling this right to increase our right to see the global global 251 00:16:44,670 --> 00:16:46,170 what that statement is missing. 252 00:16:46,410 --> 00:16:48,180 We are writing this global war 15. 253 00:16:48,180 --> 00:16:49,110 So what is happening? 254 00:16:49,320 --> 00:16:55,500 This global effort is might be having the same name as that of the global variable, but as we didn't 255 00:16:55,500 --> 00:16:57,050 write global global war here. 256 00:16:57,150 --> 00:17:02,040 So that's why this global war is working as a local variable within the right to method. 257 00:17:02,370 --> 00:17:04,650 So now what about the other were doing that? 258 00:17:05,100 --> 00:17:10,260 Their scope is confined within this right to method, so it is global for when it will get printed. 259 00:17:10,410 --> 00:17:16,120 I'm going to print the five again, not in here because we are going for the read one at the last. 260 00:17:16,470 --> 00:17:20,880 So in this way you can see that in this code how the global keyword has been used. 261 00:17:22,010 --> 00:17:28,520 We're having this in so in actually use for the membership, so here to find one list, the list will 262 00:17:28,520 --> 00:17:31,790 be included within the square brackets in our in our Biton. 263 00:17:32,150 --> 00:17:37,790 So four in a so now it is checking with the four is is a member of this list or not. 264 00:17:38,150 --> 00:17:39,620 It is producing double true. 265 00:17:40,160 --> 00:17:47,700 But if you like the same say print say 44 in a then obviously it will produce outcome as false. 266 00:17:49,010 --> 00:17:50,290 So that is a what in. 267 00:17:50,300 --> 00:17:52,070 And also we can go for the norten. 268 00:17:52,070 --> 00:17:53,510 You can also go for the Norten. 269 00:17:53,510 --> 00:17:54,320 You can find that. 270 00:17:58,100 --> 00:18:03,380 So for not being a is false and 44 not being a is true. 271 00:18:04,400 --> 00:18:11,350 Next one you are going for, this is so not true, is true, so easy secured, so its outcome is true 272 00:18:11,360 --> 00:18:17,180 here to define anonymous functions that is used at different functions, but no name without any name, 273 00:18:17,450 --> 00:18:19,160 whether using the key word lambda. 274 00:18:19,520 --> 00:18:25,220 Whenever we define a user defined function with the name we are using the key word def stands for DEFINE. 275 00:18:25,730 --> 00:18:30,380 But in case of anonymous function, anonymous method, the keyword will be lambda. 276 00:18:30,770 --> 00:18:32,010 So here you see lambda. 277 00:18:32,150 --> 00:18:33,940 So the function has got no name. 278 00:18:34,100 --> 00:18:37,430 It will take this X as input document and it returns it to it. 279 00:18:37,430 --> 00:18:43,880 Does the calculation that is X start to that is two times it will multiply this value of X and that 280 00:18:43,880 --> 00:18:44,840 will be assigned to it. 281 00:18:45,290 --> 00:18:47,960 So for I in range one, comma six. 282 00:18:47,960 --> 00:18:55,160 So that means I will be ranging from one to five and it is printing i e i that means this I will be 283 00:18:55,160 --> 00:18:55,670 passed. 284 00:18:55,940 --> 00:19:01,010 That means at first the value of I will be one, then two, then three, then four, then five. 285 00:19:01,400 --> 00:19:05,960 And this will be passed to this method and he is returning that to into X. 286 00:19:06,200 --> 00:19:07,700 So to do I will be returned. 287 00:19:07,710 --> 00:19:12,950 So I'm going to get instead of one, I shall be getting two when the value of I will be two I shall 288 00:19:12,950 --> 00:19:18,800 be getting four and the value of I will be five, I shall be getting ten here so I can also print develop 289 00:19:18,800 --> 00:19:20,570 I for the better understanding. 290 00:19:22,540 --> 00:19:24,160 Next, we are going for the nonlocal. 291 00:19:25,720 --> 00:19:31,380 So these outer function we're having, this variable A is to fight is the inner function here to have 292 00:19:31,390 --> 00:19:33,640 defined this one as nonlocal A.. 293 00:19:34,060 --> 00:19:39,880 And now we're just updating the value of eight and from the inner function, we are printing the value 294 00:19:39,880 --> 00:19:42,610 of eight from the outer function. 295 00:19:42,610 --> 00:19:44,110 Inner function has been defined. 296 00:19:44,140 --> 00:19:50,380 So now we can call the inner function and then from the outer function scope, we are printing the outer 297 00:19:50,380 --> 00:19:51,150 function eight. 298 00:19:51,490 --> 00:19:57,580 So now we're calling this outer function, using this statement so we can find that inner function has 299 00:19:57,580 --> 00:20:01,240 got assigned ten to A because he is nonlocal eight. 300 00:20:01,240 --> 00:20:03,040 That means this is nonlocal. 301 00:20:03,040 --> 00:20:08,200 That means that there is not local within this inner function that is using this eight. 302 00:20:08,500 --> 00:20:13,920 And whenever we are doing some uprate and whenever you are printing this one, I'm getting here 10 and 303 00:20:13,930 --> 00:20:14,830 from the outer function. 304 00:20:14,860 --> 00:20:18,110 And so if you print this, I shall be getting 10 back here. 305 00:20:18,460 --> 00:20:21,030 So here you are discussing the keyword. 306 00:20:21,040 --> 00:20:24,040 That is a nonlocal we're having the key word. 307 00:20:24,040 --> 00:20:27,070 There is a pass which which I've discussed already. 308 00:20:27,490 --> 00:20:29,410 So past will have no outcome. 309 00:20:29,410 --> 00:20:35,050 You can see that I run that code, but no outcome has been obtained because this is actually working 310 00:20:35,050 --> 00:20:35,980 as a placeholder. 311 00:20:36,250 --> 00:20:42,100 So in future, under this function function, if I want to add more functionalities, if I want to add 312 00:20:42,100 --> 00:20:48,820 more codes and statements, in that case, I can do this pass because it passes nothing but one placeholder 313 00:20:49,060 --> 00:20:50,980 letter for new code insertion. 314 00:20:50,980 --> 00:20:53,690 I can replace parts with the new set of goals. 315 00:20:53,870 --> 00:20:56,580 So that's why you see it is producing no outcome. 316 00:20:56,950 --> 00:20:58,360 So let me call the function also. 317 00:21:01,190 --> 00:21:04,830 Surpassing the extent you see it is producing no outcome here. 318 00:21:05,390 --> 00:21:08,710 Next, we're having this return returnee's, another very important quote. 319 00:21:08,930 --> 00:21:14,260 So is the gluten within dysfunction, the body's azy gluten and return it. 320 00:21:14,750 --> 00:21:20,510 So now whenever we are calling this function the function to return the value of that esten and we are 321 00:21:20,510 --> 00:21:21,590 printing that value here. 322 00:21:21,620 --> 00:21:23,270 So now let me go for the execution. 323 00:21:23,270 --> 00:21:24,270 I'm getting down here. 324 00:21:24,890 --> 00:21:32,240 So now we are having this while so indicates a while I is equal to five, I get a 10 zero print I and 325 00:21:32,240 --> 00:21:34,160 II is equal to a minus one. 326 00:21:34,160 --> 00:21:38,390 So I've written this one as a minus equal to one so valuable. 327 00:21:38,390 --> 00:21:44,690 I'll go on printing and this process will be continued when the value of I'll be greater than zero. 328 00:21:44,720 --> 00:21:48,050 So if I execute my code I'll be getting the output for Israel. 329 00:21:48,050 --> 00:21:50,630 Two, five, four, three, two and one. 330 00:21:51,810 --> 00:21:58,430 OK, the next keyword is with so with open example, the text W as my file. 331 00:21:58,790 --> 00:21:59,970 So now what will happen. 332 00:22:00,200 --> 00:22:08,390 This example will be opened in the right mode and here we are using the key word width and to that particular 333 00:22:08,390 --> 00:22:09,230 file pointer. 334 00:22:09,470 --> 00:22:11,090 Did this particular file reference. 335 00:22:11,090 --> 00:22:16,460 We are calling this right method and this particular string will get printed onto the example. 336 00:22:17,720 --> 00:22:21,970 So now if I go for the execution, you can find that the example, the text there. 337 00:22:21,980 --> 00:22:25,550 So let me go for the jocking example. 338 00:22:25,550 --> 00:22:32,450 The text has been created just a seconds ago and you can find that its body is having only one string. 339 00:22:32,450 --> 00:22:35,690 That is a HelloWallet which you printed here, which you printed here. 340 00:22:36,200 --> 00:22:42,380 So in this way, we using this with keyword, we can open a file either in the remote or in the right 341 00:22:42,380 --> 00:22:43,730 mode or in the open mode. 342 00:22:44,120 --> 00:22:49,660 And we are having a separate section where we have discussed that what are the different modes are possible 343 00:22:49,670 --> 00:22:52,360 and operations are possible on our data files. 344 00:22:53,120 --> 00:22:56,710 So this is the use of that with keyword we're having the field. 345 00:22:56,840 --> 00:22:59,380 That is another very important key in our generator. 346 00:23:00,200 --> 00:23:01,300 So therefore generated. 347 00:23:01,310 --> 00:23:02,360 We have defined one method. 348 00:23:02,360 --> 00:23:07,850 The name of the method is generated and for I in range six, that means he had this value up. 349 00:23:07,850 --> 00:23:10,400 I will be ranging from zero to five. 350 00:23:10,730 --> 00:23:13,780 Six means the value will be ranging from zero to five. 351 00:23:14,150 --> 00:23:17,840 And here we are not returning anything except in case of generate a function. 352 00:23:17,840 --> 00:23:23,540 We do not have the return statement we usually have the instatement yield will go on accumulating all 353 00:23:23,540 --> 00:23:25,130 the calculated values. 354 00:23:25,130 --> 00:23:26,170 So what is the value here? 355 00:23:26,330 --> 00:23:32,000 I start I, I will be ranging from zero to five, so I'm going for the square of that. 356 00:23:32,000 --> 00:23:37,190 I so it will be having the value zero one four nine six and five squared. 357 00:23:37,190 --> 00:23:38,050 That is twenty five. 358 00:23:38,480 --> 00:23:41,110 So now it will return one iterator. 359 00:23:41,120 --> 00:23:49,430 So now the outcome will be will be operating in G and then from four I n g I shall go on printing the 360 00:23:49,430 --> 00:23:52,640 value of Pi and the respective outcome will be operand here. 361 00:23:52,970 --> 00:23:58,750 So instead of having that return in case of Ginetta functions will be having the key word ILD, which 362 00:23:58,760 --> 00:24:01,670 will go on accumulating all the calculated values. 363 00:24:01,670 --> 00:24:07,550 And later from this iterator we can using the for loop, we can pick up each and every element at the 364 00:24:07,550 --> 00:24:11,500 time in one loop, in one iteration and go on doing the competitions. 365 00:24:11,510 --> 00:24:14,710 But here we have just put the value of EI here. 366 00:24:15,230 --> 00:24:19,550 So in this particular example, we have discussed multiple different keywords. 367 00:24:19,550 --> 00:24:24,260 You can see that so many different keywords we have defined other than these are the key words are also 368 00:24:24,260 --> 00:24:24,770 available. 369 00:24:25,010 --> 00:24:30,110 But these are the most usable and frequently used keywords in our python code. 370 00:24:30,860 --> 00:24:38,470 And on them we have written small example calls and we have explained that one with the required outputs. 371 00:24:38,990 --> 00:24:40,190 Thanks for watching this video.