So in our case, we have used the comparison operator that is more than equal.
OK, so here the expression that basically follows the mile that is I more than equal to zero contains
two values, the value in the variable I and the integer value zero connected by more than equals sign,
OK.
Now this is basically also greater than or equal to operate.
That is also on comparison operate.
Now we use the comparison operators to compare two values and evaluate to true or false.
OK, that is either the condition might be true or the condition might be false.
You might not have any other value for it.
OK, so some other comparison operators that we have are you're less than sane.
OK, now for example, OK, let's see here, for example, we see hash and we write down here say more
than this is this then then you have more then you have less than equal to more than equal to double
is equal to is equal to and not equal to for negative.
OK, so these are all different types of comparison operators' which you have now.
You can check this expression's by entering them directly into the interactive shell to get the boolean
values which are evaluated.
For example, if we say over here, C zero is less than six, you get the values true or we say six
is less than zero.
We get the value as false or we say 50 is less than ten point five.
We get again, forty seven point five is less than eleven point.
Three, we are to at the value or we say pennies then then again at this for right.
So here it is, just evaluate by what values you are passing on if they are less than or equal to a
particular value.
Similarly, if you check for less than equal to, say, 10 is less than equal to 20 will be true.
But if we said ten is less than equal to ten will be also true because it is not legitimate is equal.
Right.
Similarly, ten more than equal 220 is Foote's or 20 more than equal to 20 will become true.
Right.
So over here we have on notice that unless an equal two is true because the operator checks, if ten
is less than or equal to them.
So it is not doing it should be less than or equal.
So either if it is not less than what if it is even equal to will give it to right now.
Similarly, we can also check for some equal or not equal operators.
So like if we say in the equal to ten will be true.
But if we said then double equal to eleven would be false or 11 equal to ten will be also false.
If we said then not equal to ten will be false.
But if we said then not equal to 11 will be true because ten is not equal to that expression comes true.
Right.
So this is basically just the ways we have given you that, how the values would be evaluated when you
look at the interactive shell of Python.
OK, now these operators basically work, as you would expect, for integers.
Not comparing integer that are equal to each other with the equal to operator evaluates as true and
unequal values.
Now, when you compare with the not equal operator, it is the opposite.
Now this comparisons of operators very similar with strings.
For example, if your vesi hll or hello, if that's equal to again a or in the same case will give you.
But if you say it is equal to say goodbye, then will give you force, or for that matter, if you even
try to see.
One in capital, then small, the second one in a whole capital will also give you a fourth because
this is case sensitive.
So for a small E and the capital is different, right?
Similarly, if you say good bye is not equal to hello, this will give you a because they are actually
not quite right.
So here only the capitalization matters to buy.
And so string values that don't match the capitalization.
Exactly.
Not the same string, for example, the strings like we have done hello in the capital.
Right.
So over here we also have the difference between the assignment operator and the equal or the comparison
operator.
That is, if, for example, like in the loop we have done if we go back to the program over here,
this is an assignment operator where we're assigning a particular value to.
Right.
But over here we are putting a value in the variable.
OK, like in this particular shell we are trying to do this is or this this is for equality and a single
equal to is for your assignment.
Right.
So both are different.
OK, now some similar examples for assignment.
If you want to check number with string will also give you a fourth.
But if you try to do it something like 40 to supples equal to 42, but in a string format will be also
forced because one is integer.
Another one is string.
But for that particular matter, if you say PIN number is equal to ten point, then we'll give you.
Right.
So even though they look like integer 42 and string 42, they aren't considered as equal because a string
isn't the same as a number, whereas individuals and the floating point numbers can be equal to each
other because they both are numbers.
Right.
So when you're working with the comparison operators, just remember that every explanation always evaluates
to true value or it would be a false one.
Right.
So after this, we would let you just go on ahead and really go through the loop statement that we have.
So if we come back over here after we have done with this, we go in the loop statement where we are
putting the value of the translated plus the value of message into the variable translated and discriminating
the value of ivory with it.
OK, so here why the statement tells Python to first check what the condition evaluates to, which is
basically like VSC is more than equal to zero.
You think that the statement, while I'm more than equal to zero as meaning while the variable is greater
than or equal to zero, so keep executing the code in the following blocks.
If the condition evaluates true through the program, execution will enter the block following revised
statements and by looking at the indentation that is after all, we have given this indentation, if
we can see, which means these two statements are a part of this loop.
Right.
So when it reaches the bottom of the block program, executes or execution jumps back to the statement
and checks the condition again.
So if it is still true again, the execution will jump into the stock of the block and run the code
in the block of it.
If the condition evaluates to false only then the program execution skips the code inside the following
block and jumps down after the line that is after this line and will come over here and will give you
the printed result of the.
So now keep in mind that the eye is equal to lend message minus one, the eye variable is full circle,
the length of the message minus one and the eye loop on the next line keeps executing the lines inside
the voting block until the condition eye becomes more than equal to zero is false.
OK, at the end, when we say over here, it is basically an assignment statement that stores the value
in a translated variable and the value that is stored in the current value is translated.
Concatenate with the characters at the index in the message variable.
So as a result, the string value stored and translated automatically grows one one character at a time
until it becomes a fully encrypted string.
OK, so over here, when we see eye to eye minus one, we are taking the current integer value in and
subtract one from it.
Now this basically also known as decrypting the value of the variable.
OK, when it stores or when it stores this value as a new value of now here we have made this.
OK, so after this, we have made this blank so that we are seeing this loop ends here and this becomes
again for demolition starts from the start, which means now we are going to go for the next execution
of line.
That is opening statement.
So when this little execution completes at the end, we get the result printed over here.
Now, let's think about the behavior of the loop to understand how many times it runs the coding of
law, not the variable.
I start with the value of the last index of message and translated variable starts as a blank string.
Then inside the loop, the value of message I like that we are storing is added to the end of the translated
string.
Then the value of EI is decrements by one meaning that the message I will be this second to the last
character.
So when I as an index keeps moving from back to the front, the string is added at the end of the translated
variable.
But this is basically how the translated ends up holding the reverse of the string in the message.
So when I finally set up the minus one, which happens when we reach the index zero and of high loops,
condition becomes followed, the execution jumps back to the.
But in statemented right now, suppose you are having trouble understanding how the code in the loop
reverses the string.
We will try adding some new lines of code in the loop.
OK, what we will do is in the loop block.
While we are saying I use more than Equable Zero, we are saying translated.
OK, after this particular line, let us add one more line here.
Giving print here we say I his guama print the value of I here give a comma.
Then again we give C.
OK, here we are again, and this is a message at the index is we close this when we bring the value
of the message at the index.
Then again, we open a single quotation marks.
We see.
Translated is.
Plus this, and we bring the value of.
Translated here, and then we have this I equals to minus one, then we put in the value of translation.
OK, now let's save this and run the module again.