1 00:00:00,150 --> 00:00:04,500 So in our case, we have used the comparison operator that is more than equal. 2 00:00:04,830 --> 00:00:12,330 OK, so here the expression that basically follows the mile that is I more than equal to zero contains 3 00:00:12,480 --> 00:00:18,940 two values, the value in the variable I and the integer value zero connected by more than equals sign, 4 00:00:19,020 --> 00:00:19,310 OK. 5 00:00:19,340 --> 00:00:22,840 Now this is basically also greater than or equal to operate. 6 00:00:23,040 --> 00:00:25,070 That is also on comparison operate. 7 00:00:25,440 --> 00:00:30,930 Now we use the comparison operators to compare two values and evaluate to true or false. 8 00:00:31,260 --> 00:00:35,600 OK, that is either the condition might be true or the condition might be false. 9 00:00:35,610 --> 00:00:37,590 You might not have any other value for it. 10 00:00:37,950 --> 00:00:43,230 OK, so some other comparison operators that we have are you're less than sane. 11 00:00:43,440 --> 00:00:51,720 OK, now for example, OK, let's see here, for example, we see hash and we write down here say more 12 00:00:51,720 --> 00:00:57,900 than this is this then then you have more then you have less than equal to more than equal to double 13 00:00:57,900 --> 00:01:01,800 is equal to is equal to and not equal to for negative. 14 00:01:02,010 --> 00:01:06,660 OK, so these are all different types of comparison operators' which you have now. 15 00:01:06,690 --> 00:01:12,270 You can check this expression's by entering them directly into the interactive shell to get the boolean 16 00:01:12,270 --> 00:01:13,580 values which are evaluated. 17 00:01:14,010 --> 00:01:22,560 For example, if we say over here, C zero is less than six, you get the values true or we say six 18 00:01:22,560 --> 00:01:23,570 is less than zero. 19 00:01:23,730 --> 00:01:28,790 We get the value as false or we say 50 is less than ten point five. 20 00:01:29,250 --> 00:01:33,480 We get again, forty seven point five is less than eleven point. 21 00:01:34,550 --> 00:01:41,590 Three, we are to at the value or we say pennies then then again at this for right. 22 00:01:41,720 --> 00:01:48,680 So here it is, just evaluate by what values you are passing on if they are less than or equal to a 23 00:01:48,680 --> 00:01:49,640 particular value. 24 00:01:49,910 --> 00:01:56,180 Similarly, if you check for less than equal to, say, 10 is less than equal to 20 will be true. 25 00:01:56,360 --> 00:02:02,240 But if we said ten is less than equal to ten will be also true because it is not legitimate is equal. 26 00:02:02,750 --> 00:02:03,030 Right. 27 00:02:03,380 --> 00:02:11,350 Similarly, ten more than equal 220 is Foote's or 20 more than equal to 20 will become true. 28 00:02:11,660 --> 00:02:11,960 Right. 29 00:02:12,200 --> 00:02:18,440 So over here we have on notice that unless an equal two is true because the operator checks, if ten 30 00:02:18,440 --> 00:02:20,220 is less than or equal to them. 31 00:02:20,570 --> 00:02:23,010 So it is not doing it should be less than or equal. 32 00:02:23,540 --> 00:02:29,190 So either if it is not less than what if it is even equal to will give it to right now. 33 00:02:29,210 --> 00:02:32,920 Similarly, we can also check for some equal or not equal operators. 34 00:02:33,200 --> 00:02:36,460 So like if we say in the equal to ten will be true. 35 00:02:36,770 --> 00:02:43,010 But if we said then double equal to eleven would be false or 11 equal to ten will be also false. 36 00:02:43,430 --> 00:02:47,810 If we said then not equal to ten will be false. 37 00:02:48,060 --> 00:02:55,790 But if we said then not equal to 11 will be true because ten is not equal to that expression comes true. 38 00:02:56,180 --> 00:02:56,520 Right. 39 00:02:56,960 --> 00:03:02,660 So this is basically just the ways we have given you that, how the values would be evaluated when you 40 00:03:02,660 --> 00:03:05,030 look at the interactive shell of Python. 41 00:03:05,520 --> 00:03:10,610 OK, now these operators basically work, as you would expect, for integers. 42 00:03:10,880 --> 00:03:17,600 Not comparing integer that are equal to each other with the equal to operator evaluates as true and 43 00:03:17,600 --> 00:03:18,530 unequal values. 44 00:03:19,370 --> 00:03:22,730 Now, when you compare with the not equal operator, it is the opposite. 45 00:03:23,210 --> 00:03:27,590 Now this comparisons of operators very similar with strings. 46 00:03:28,100 --> 00:03:36,790 For example, if your vesi hll or hello, if that's equal to again a or in the same case will give you. 47 00:03:37,460 --> 00:03:48,230 But if you say it is equal to say goodbye, then will give you force, or for that matter, if you even 48 00:03:48,230 --> 00:03:48,980 try to see. 49 00:03:51,180 --> 00:03:58,110 One in capital, then small, the second one in a whole capital will also give you a fourth because 50 00:03:58,110 --> 00:03:59,190 this is case sensitive. 51 00:03:59,200 --> 00:04:03,070 So for a small E and the capital is different, right? 52 00:04:03,330 --> 00:04:11,130 Similarly, if you say good bye is not equal to hello, this will give you a because they are actually 53 00:04:11,130 --> 00:04:12,530 not quite right. 54 00:04:12,810 --> 00:04:15,750 So here only the capitalization matters to buy. 55 00:04:15,870 --> 00:04:19,080 And so string values that don't match the capitalization. 56 00:04:19,320 --> 00:04:20,100 Exactly. 57 00:04:20,190 --> 00:04:24,660 Not the same string, for example, the strings like we have done hello in the capital. 58 00:04:25,170 --> 00:04:25,530 Right. 59 00:04:25,830 --> 00:04:31,380 So over here we also have the difference between the assignment operator and the equal or the comparison 60 00:04:31,380 --> 00:04:31,860 operator. 61 00:04:32,180 --> 00:04:39,300 That is, if, for example, like in the loop we have done if we go back to the program over here, 62 00:04:39,540 --> 00:04:42,960 this is an assignment operator where we're assigning a particular value to. 63 00:04:43,470 --> 00:04:43,840 Right. 64 00:04:43,860 --> 00:04:47,970 But over here we are putting a value in the variable. 65 00:04:48,370 --> 00:04:55,110 OK, like in this particular shell we are trying to do this is or this this is for equality and a single 66 00:04:55,110 --> 00:04:56,850 equal to is for your assignment. 67 00:04:57,330 --> 00:04:57,550 Right. 68 00:04:57,600 --> 00:04:58,980 So both are different. 69 00:04:59,010 --> 00:05:01,620 OK, now some similar examples for assignment. 70 00:05:01,620 --> 00:05:06,350 If you want to check number with string will also give you a fourth. 71 00:05:06,360 --> 00:05:14,580 But if you try to do it something like 40 to supples equal to 42, but in a string format will be also 72 00:05:14,580 --> 00:05:16,140 forced because one is integer. 73 00:05:16,170 --> 00:05:17,690 Another one is string. 74 00:05:18,060 --> 00:05:23,730 But for that particular matter, if you say PIN number is equal to ten point, then we'll give you. 75 00:05:24,930 --> 00:05:25,170 Right. 76 00:05:25,500 --> 00:05:32,820 So even though they look like integer 42 and string 42, they aren't considered as equal because a string 77 00:05:32,820 --> 00:05:38,160 isn't the same as a number, whereas individuals and the floating point numbers can be equal to each 78 00:05:38,160 --> 00:05:40,350 other because they both are numbers. 79 00:05:40,710 --> 00:05:40,980 Right. 80 00:05:41,160 --> 00:05:46,860 So when you're working with the comparison operators, just remember that every explanation always evaluates 81 00:05:46,860 --> 00:05:50,070 to true value or it would be a false one. 82 00:05:50,250 --> 00:05:50,560 Right. 83 00:05:50,880 --> 00:05:57,450 So after this, we would let you just go on ahead and really go through the loop statement that we have. 84 00:05:57,480 --> 00:06:03,720 So if we come back over here after we have done with this, we go in the loop statement where we are 85 00:06:03,720 --> 00:06:11,460 putting the value of the translated plus the value of message into the variable translated and discriminating 86 00:06:11,460 --> 00:06:13,220 the value of ivory with it. 87 00:06:13,500 --> 00:06:20,820 OK, so here why the statement tells Python to first check what the condition evaluates to, which is 88 00:06:20,940 --> 00:06:24,160 basically like VSC is more than equal to zero. 89 00:06:24,570 --> 00:06:30,480 You think that the statement, while I'm more than equal to zero as meaning while the variable is greater 90 00:06:30,480 --> 00:06:34,600 than or equal to zero, so keep executing the code in the following blocks. 91 00:06:34,640 --> 00:06:40,170 If the condition evaluates true through the program, execution will enter the block following revised 92 00:06:40,170 --> 00:06:45,630 statements and by looking at the indentation that is after all, we have given this indentation, if 93 00:06:45,630 --> 00:06:49,190 we can see, which means these two statements are a part of this loop. 94 00:06:49,590 --> 00:06:49,940 Right. 95 00:06:49,980 --> 00:06:55,650 So when it reaches the bottom of the block program, executes or execution jumps back to the statement 96 00:06:56,460 --> 00:06:57,850 and checks the condition again. 97 00:06:58,200 --> 00:07:03,540 So if it is still true again, the execution will jump into the stock of the block and run the code 98 00:07:03,540 --> 00:07:04,790 in the block of it. 99 00:07:05,190 --> 00:07:12,180 If the condition evaluates to false only then the program execution skips the code inside the following 100 00:07:12,180 --> 00:07:18,750 block and jumps down after the line that is after this line and will come over here and will give you 101 00:07:18,750 --> 00:07:20,730 the printed result of the. 102 00:07:22,510 --> 00:07:30,600 So now keep in mind that the eye is equal to lend message minus one, the eye variable is full circle, 103 00:07:30,610 --> 00:07:37,150 the length of the message minus one and the eye loop on the next line keeps executing the lines inside 104 00:07:37,150 --> 00:07:42,050 the voting block until the condition eye becomes more than equal to zero is false. 105 00:07:42,460 --> 00:07:48,640 OK, at the end, when we say over here, it is basically an assignment statement that stores the value 106 00:07:48,640 --> 00:07:53,350 in a translated variable and the value that is stored in the current value is translated. 107 00:07:53,350 --> 00:07:57,890 Concatenate with the characters at the index in the message variable. 108 00:07:58,210 --> 00:08:04,330 So as a result, the string value stored and translated automatically grows one one character at a time 109 00:08:04,780 --> 00:08:07,390 until it becomes a fully encrypted string. 110 00:08:07,940 --> 00:08:15,280 OK, so over here, when we see eye to eye minus one, we are taking the current integer value in and 111 00:08:15,280 --> 00:08:16,510 subtract one from it. 112 00:08:16,900 --> 00:08:20,690 Now this basically also known as decrypting the value of the variable. 113 00:08:21,080 --> 00:08:28,000 OK, when it stores or when it stores this value as a new value of now here we have made this. 114 00:08:28,900 --> 00:08:34,870 OK, so after this, we have made this blank so that we are seeing this loop ends here and this becomes 115 00:08:34,870 --> 00:08:40,870 again for demolition starts from the start, which means now we are going to go for the next execution 116 00:08:40,870 --> 00:08:41,320 of line. 117 00:08:41,320 --> 00:08:42,560 That is opening statement. 118 00:08:42,880 --> 00:08:48,580 So when this little execution completes at the end, we get the result printed over here. 119 00:08:49,060 --> 00:08:55,030 Now, let's think about the behavior of the loop to understand how many times it runs the coding of 120 00:08:55,030 --> 00:08:56,560 law, not the variable. 121 00:08:56,570 --> 00:09:02,830 I start with the value of the last index of message and translated variable starts as a blank string. 122 00:09:03,400 --> 00:09:10,090 Then inside the loop, the value of message I like that we are storing is added to the end of the translated 123 00:09:10,090 --> 00:09:10,510 string. 124 00:09:10,960 --> 00:09:17,080 Then the value of EI is decrements by one meaning that the message I will be this second to the last 125 00:09:17,080 --> 00:09:17,590 character. 126 00:09:17,950 --> 00:09:26,380 So when I as an index keeps moving from back to the front, the string is added at the end of the translated 127 00:09:26,380 --> 00:09:26,840 variable. 128 00:09:27,280 --> 00:09:32,420 But this is basically how the translated ends up holding the reverse of the string in the message. 129 00:09:32,950 --> 00:09:39,430 So when I finally set up the minus one, which happens when we reach the index zero and of high loops, 130 00:09:39,430 --> 00:09:43,110 condition becomes followed, the execution jumps back to the. 131 00:09:43,180 --> 00:09:50,050 But in statemented right now, suppose you are having trouble understanding how the code in the loop 132 00:09:50,050 --> 00:09:51,130 reverses the string. 133 00:09:51,550 --> 00:09:54,500 We will try adding some new lines of code in the loop. 134 00:09:54,970 --> 00:09:57,690 OK, what we will do is in the loop block. 135 00:09:57,700 --> 00:10:01,930 While we are saying I use more than Equable Zero, we are saying translated. 136 00:10:02,080 --> 00:10:06,400 OK, after this particular line, let us add one more line here. 137 00:10:06,700 --> 00:10:14,030 Giving print here we say I his guama print the value of I here give a comma. 138 00:10:14,470 --> 00:10:16,300 Then again we give C. 139 00:10:18,030 --> 00:10:27,810 OK, here we are again, and this is a message at the index is we close this when we bring the value 140 00:10:27,810 --> 00:10:29,850 of the message at the index. 141 00:10:30,750 --> 00:10:33,570 Then again, we open a single quotation marks. 142 00:10:33,900 --> 00:10:34,500 We see. 143 00:10:35,970 --> 00:10:37,560 Translated is. 144 00:10:38,890 --> 00:10:41,170 Plus this, and we bring the value of. 145 00:10:42,320 --> 00:10:49,310 Translated here, and then we have this I equals to minus one, then we put in the value of translation. 146 00:10:49,340 --> 00:10:53,860 OK, now let's save this and run the module again.