The activities for these years Armed Forces Remembrance Day and Appeal for Funds have commenced in Benway State with an interdenominational church service organized by the Benway State Chapter of the Christian Association of Nigeria in conjunction with the State Government. The service which is held at the Cherubim and Seraphim Church movement in Macro-D was dominated by prayers for those who fought for Nigeria's independence, divine protection of the members of the Armed Forces and other paramilitary, and the families of the ex-servicemen among others. A correspondent Francis Thayer reports that the Benway State Governor Samuel Automat acknowledged the contributions of the Armed Forces in sacrificing their lives for the peace of the nation. He was represented by the State Deputy Governor Indina Benson Abono. The Armed Forces have been doing in this nation and therefore to thank you for those of you who are alive and to extend their thanks and gratitudes for those of you who have put down their lives and are now in the great beyond. I want to thank you and thank you for the power of my heart. What you have done for this nation cannot be measured for in Nigeria today the only institution that I dare and I make bold to say still has a semblance of equity, fairness and justice is the Armed Forces. In his remark, the Benway State Cairn Chairman Reverend Dr. Angwen Lever enjoined Nigerians to pray for the forthcoming general elections in the country. For successful elections, not only successful peaceful elections, God is on the throne. I also implore you to pray for my little Benway State. Pray for our government. There has been a voice for the voiceless. And through him, God is doing marvelous things in this nation. I'm happy to say that he has an impeccable deputy who is fearless, who speaks on behalf of the state. Sir, I salute you.


Hey guys, welcome back to Comic Gaiden. I'm John Wise here with yet another Teenage Mutant Ninja Turtles Blast from the Past, an action figure of Metalhead. Another fan favorite action figure review right here. Metalhead was an awesome figure when he came out, mostly because you'll notice he's crowned and that's really cool. So saying that, let's go ahead and go right into the paint detail and articulation. First off, typical articulation with this guy. Head moves from right to left. Mine is very stiff. Arms move up and down. This guy, with him being an engine turtle, has that standard forearm wrist articulation that all the turtles have. You can move forward backwards on that ball joint. This guy features something that the other turtles don't, which you'll see his little cybernetic brain there. I'm going to try seeing if I can get this to work. But with that cybernetic brain, take a look at this. If you put light under it, boom, his eyes glow. Check that out. Boom! That is really cool. So that was one of an awesome feature he has as an engine turtle belt with a T. Knowspots to hold weapons, which you'll notice there's a few holes here. That's due to part of his accessories. He had a little backpack that would plug in the back of here that had straps that would come up and attach here that plug in right there. I'm trying to remember all the accessories that he had. He had quite a few. I have one accessory and that's his robotic nunchucks. Now you'll notice he doesn't hold these the way a normal turtle would hold them. For this, he had a unique feature where his wrists here would pop off like so, and then you would attach the weapon like so. And there is his weapon. So that's pretty neat. This one is based on his animated appearance in the 80s. He has a little red painting here. He doesn't have a whole lot of paint detail. What he does have is really cool. He's got the little cybernetic arms here with the little wires. He's got the pads just like the Ninja Turtles themselves. Of course, the green and yellow feet. Again, an awesome fun figure. This was another one of my favorites growing up. We have the chrome detailing on the back. It goes all the way to the front. And of course, just like Michelangelo, Raphael, Donatello, Leonardo, who have their initials on their belts, we have Metalhead's T for turtle. So I'm not sure why they didn't go M for Metalhead, maybe because Michelangelo already has an M on there. So they opted to put the T on there for turtle instead. I don't know. This was a pretty popular figure back in the day. Every kid had one. And for good reason, he was really, really, really cool. So here we go. We have the T for Turtles Metalhead. So thanks for tuning in and we'll catch you next time. Hey guys, if you like this video, make sure you smash that subscribe button and click on the little bell to receive notifications on all our upcoming videos. Hit the like button, make sure and leave us a comment so we know how you felt about this video. And don't forget to share with your family and friends. Until next time, I'm Shannon for Come Again. We're all geek culture collides.


Thus far we finished chapter one and chapter two, where you did some really simple programming using the strings and numbers with the last two assignments or so. So today we'll look at chapter three is a complete chapter covering the decisions. So the decision in this case is that diamond shape we have been looking at in your flow chart, okay? And let me also open this note here. We'll take a look at that in a minute. So right here, we see the flow chart. Again, this is from chapter three. So in the figure five, you can see that this is something we already kind of discussed before. Three symbols here are very common. You will use a lot in your program. So the first one is this rectangular or square symbol, which usually is a task symbol, right? When you process information, you will use that. So it has to be a square or rectangular. Well, in other words, the four corners or angles has to be 90 degrees, right? As opposed to this one here, this shape here is commonly known as a parallelogram, although that's completely debatable because both of these are in the, actually all of these are parallelograms, right? So we say the slanted sides. This symbol here is used for input and output. Okay, so if you've seen that in my comments to you and your assignments, so just be aware that these mean different things, okay? And then the diamond symbol here is the condition or the decision structure. This one did not show the input, but there should be exactly one input coming in like you see down here, and then exactly two output here, but or we call it branches, but only one of these branches will run, okay? Never both and never none. It has to be one branch must run, okay? So these symbols are used a lot in programming and you'll be writing a lot of these as well. So here's another example here. Now we put some information into these boxes and you see that we test a condition in the diamond shape then there will always result in a true or false branch and then we follow the flow of flow line. So data program only flows in one line. Cannot do both at the same time. On the right side is a pseudocode that will kind of tell you what it looks like using the if and else statements. And then this is another example where it shows you have multiple choices or multiple branches or sometimes alternative branches. Okay, so you have choices, choice one, two and three, but you cannot have all the choices in the same symbol. So you have to run each choice separately as you go down. Again, choice one, then if choice one is true, in this case, then you will follow the true branch over here if you process something in the true branch and then you continue on your exit out. Okay, if choice one is not true, then you follow the false branch and then you check for choice two and so on, okay? And this is a multiple or if statements or sometimes it's called the nested statements as well, we'll see a little bit later. So on the right side is two ways how you can actually structure this using Python. Okay, again, this is still kind of pseudocode because this is not actual code, right? Python doesn't let you use the bracket like this. I'm just putting here. So it looks very similar to Python code. This is still a pseudocode. So you can do it with this approach. As you can see, the code is like going deeper and deeper and further out to the right as opposed to on the right, everything is like straight down. Okay, so I mentioned last time that one of the principles of Zen is flat is better, right? So you don't want nested because it's really hard to read and it's hard to debug as well. So that's that at the down here. You must also make sure you understand this truth tables, okay? When we use and or and not the operators here for compound conditions, right? So when you test two or more conditions, you will always result in a true or false value. So again, just example saying that the value for A is true, the value for B is true. If A and B, then the end means that both has to be true, right? So in this case, you see that all these are false because both A and B are not true. So again, at the end symbol and or operator and the not operator here, right? So the not is actually very simple. It's basically the inverse of whatever this value is. If you not A, then you change the true to false and vice versa. So this is a very useful approach method or a method to construct a program that behaves like a light switch, right?  That will be you basically you not, they value every time it will turn on and off that way as you go. And again, we'll do this later when you see how this is being used in a loop later, okay? Down here is another example, a little bit more practical I guess is this program here shows you how long it will take you to travel from one place to another based on rush hour, right? For example, you cross the Bay Bridge, I guess Bay Bridge would be in someone in San Francisco and is, are you traveling during rush hour or not, right? And then what, or I guess, are you traveling via the Bay Bridge? If you do not travel by the Bay Bridge, then you go to the know or the false branch and then your travel time will be about 45 minutes. If you do travel through the Bay Bridge, then it goes to the yes branch and then I ask you another prompt here, is this during rush hour or not, right? Rush hours, I guess usually between 4 to 6 pm from that time is very, very busy. If it is during the rush hour, then the travel time will be about 60 minutes as opposed to 30 minutes, right? So if you were to look at this here and on the right side is the actual code or the pseudo code for that. Okay, so we talked about these different types of data, types in Python last time. So I'd say that the one in greens are the primitive type and then the blue or light blue over here are the reference type. And there is a huge, there's a distinction between the two. So I want to kind of show you what that is, give you a little demo and then we'll move on, okay? So that, because there is another operator that some students or some people tend to use and you won't actually, you'll get an incorrect result. Okay, so here is the primitive versus reference type. So primitive type means like integer, floating numbers, a Boolean, the things like that, okay? So for example, when we talk about reference primitive type, the primitive value will look something like, let's just say num1 or num equals the 12. Let's put num1 and we'll put another one here, num2. Okay, oh, by the way, you can do this or in Python because it's so flexible, you can also initialize your value like this. I show you less than one. And then if they are both the same, I showed you last time, num1 equals num2 equals 12, right? So that's another approach you can do or you can also do this. Num1, num2 is equal to 12 and 120 like that, okay? So that means that the position here has to match. So 12 goes to n1, 20 goes to n2, okay? So there are a lot of ways so you can initialize your data in Python, very flexible. So some people, this may not be as useful, but a lot of people will use this approach and if you see that, that's what that means, okay? So I'm just throwing that out there for you just in case if you see it. But I'll do this approach so it's easier for us to see. Okay, so num1 and num2, there is a, so when you check whether those two numbers are the same or not, we'll look at the operator just a minute, okay? So there is a comparison operator which is the double equal sign. So if I put here num1 equals equal num2, okay? If you print this out, right? Like that, what you're gonna get is either a true or false, okay? True or false. So this is a comparison operator. The two equal signs here I'm comparing is num1 equal num2, the value of these two variables. And so if this is the case, then I'm gonna run it and you will see the output it says right here, it says true, okay? It's true here. Because they are indeed the same. Now, if I change one of these two, you know, 11, then of course that is no longer true. You get a false, right? Pretty typical how you compare two variables. So and why is it true? Is because the reason why is how we use this operator here, okay? This is called the quality operator. And there is another operator that some people will like to use and it's called num1 is num2, like that. So the is operator is another one, which is not very common, I guess in this, not in common in this way, but some people like to use it because it's like English sentence, right? It makes sense, right? Now one is num2. So if I print both of those, we'll see that both should be false, right? Because they're not the same. So if I put back to 12, then I expect both to be true because they're indeed the same, okay? So this is true because the data type here for num1 and num2 are actually, as you look here is a int type, which means they are primitive, right? So when you're comparing primitive data, either this or this is operator will work the same way. They're equal or not equal, okay? Now, if I change this num1 and I wrap those, both of those into a square bracket, okay? Now the square bracket here will learn much later in chapter six, these are called lists, a list data type. A list is a reference type, right? If you look at the chart here, a list is a reference type, same as tuple instead of dictionary, we'll do that later. So a reference type, as you can see, when we run the same statements up here, wanna run it, you see that the first statement is true, but the second statement is not true, okay? So when you compare reference data type, the is operator will not give you what you expect. And the reason why is because when you're comparing reference data type, you are comparing the memory addresses as opposed to the value, okay? When you compare primitive type or when you use the equal operator, you're comparing the value as opposed to the memory address, right? So that's one distinction. And I can show you here, I can print as print the memory address of number one, okay? I put here, let's push here number one. So we can see the memory address. This is how you can actually, this is not the actual main address, but it give you an idea that the hex value of this number, which is related to a memory storage and your computer is either the same or not the same. Okay, so you put here number two. So it's a hex function, the idea of the variable here and we'll give you that information. Okay, so when you run this statement, you're gonna see that the memory address for number one is this and number two is this. So they're not exactly the same, okay? So when you compare using the double equal sign, you are comparing the actual value, which is 12, that is two variable store. But when you use the is operator, you're comparing the memory addresses. So because the memory addresses are different, the value here is not compared using the is operator, okay? So be careful when you do that, if you happen to Google somewhere and look for some answers and they'll use is or is not, just be careful that you are comparing the memory addresses as opposed to the value, right? However, if you do this, if I'd say number one, I mean, number two is equal to number one, okay? If I sign that and you wanna see that now, the memory addresses are exactly the same, okay? So in this case, both are true, right? Because with the reference type, what this one does is basically pointing its location to the same memory address as number one. So wherever number one is, number two is exactly that position. So the analogy of this is like a bank account, right? Or a credit card account that you share your credit card with another person in the family and however many credit cards you issue out, they're all pointing to the same account. So if you add money or use money out of that account, all the other values, people or card also effective. So what that means is if I change, if I change number one, we'll have this later, from 12 to 100, okay? You're gonna see that the value up here for both number and number two should also be changed to 100 as well. Even though I never touched number two, right? I changed number one's value from 12 to 100. This is the assigned operator. Again, we'll look at this in chapter six. I'll just show you that because they share the same memory address, number two's value also changed to 100 automatically, okay? So that is a different between the two types. And so because of that, I do want to warn you that try not to use the is in your program. Okay, so what that means is like, if you were to do this in a program like this, if these are the is statements, if number one is equal to number two, then you print like yes, for example, else print no. Okay, so if I run this program, it should print, and so, I mean, let's go back to this example here, put 12 here like that, right? So this case, it should be yes because they are indeed equal. Okay, so you can see down here is yes. If you change that to something else like 11, then of course that would be no, okay? If you put back to 12, and if you use the is instead, then you got to get no in regardless of what you have inside here. So it will always be no, because the memory address would never be the same. Okay, so just watch out for that side effect just because it's convenient to write, it doesn't mean you got to give you the result that you wanted. Okay, so with that said, let's look at the if statements. Now in Python, let's go a new one over here. Look at the decision. So a decision in Python is using the if statements, okay? So if like that, and you have a condition here, so let's go back to, let's do it this way, and let's do anyone here. Anyone is 10, and then into is 20, right? So when you compare, this is the if statements followed by the expression. Expression here will be a comparison if n1. So when you do the decision, again you do some type of operation, okay? The operation here will always result to what's called a true V or false C value. That means that the condition, whether you have a single condition or you have a compound conditions, we have a lot of conditions to test in there. The end result will always be a single true or false, okay? So in this case, if I'd say if n is greater than n2, if that is true, it will always test for true, okay? So the first if statements here that are followed by a colon, this colon here represents a code block. Okay, I briefly download this last week, a code block, and this is the only time where you have to, where you can indent your code in Python, okay? You cannot just indent your code even a single space other than the comments, right? We learned that last time. So this idea will automatically indent it for spaces for you if you don't have this option, then you can indent at least one space, but I recommend at least two or more, okay? It's easier to read. And then this is the true branch. I've got a note here. This is always the true branch, okay? It cannot be the false branch. It's always a true branch, even though if I test false equals false, right? Because the result will be true or whatever, right? So this is a true branch. And then if this is all you have to do, let's say you do something here, you can say you create a message saying, and one is a larger like that. If that is all I need to do, then you end the program here. And then at the end, you will print another statement maybe and program. So you know that the program ends at that point.  So in this case, I'm only concerned about the true branch. I don't care about the false branch. So if you don't care about it, if you want to do anything about it, you can ignore that. So when I execute this statement, I should expect a false because and one is indeed not less, not really and two. So I'm not going to see this statement, right? It's not true. So therefore this will be skipped and all I see is just the end program to print and the console over there. Okay, because that is not true. However, if you change it around, if it's less than and two, now that it's true because indeed that's true, we're going to see this printed and then after this block. So from here to here, from this column to the line 10 is the one block of code. After that, if there are no more statements or if your statements is indented back to the other back to, okay, if you do that, so be careful also, that means that both of these statements are a part of the if branch. Therefore these two will only be printed if the value here is true, otherwise you won't see anything, right? So because the indication here is important. So sometimes you have to be careful and if you accidentally in your code as well, maybe you unintentionally put your line back to that position, then this statement here is in the outer branch, right? And this is in the inner branch, okay? So therefore I don't recommend you write code this way. It's very confusing to see. We like clarity. So make sure you have at least one space or more, you know, for the next block of code or so. So you can clearly see the indentation here. If you look at indentation again, by the way it is very beautiful or you can easily see your code and where they fall and how they executed. So in this case, you should see both statements being printed down here. Okay. So this is the, let me see if I can do that. So for that one, that is this symbol here, right? We have a condition symbol like this. Okay. Then we have a branch that is true. So you can do level write as a matter. You go one here, right? And you have the other one. You can say this is the other false branch, right? So we have this condition goes right in this box here. Okay. The data coming through this way. And then we test it here. Is it a true or false? Okay. If it's true, then we will print a print function is this parallelogram. Okay. Remember that. And then it's true. So this will be right in here. That's the true branch. And then this is an outer outside of the if block. It's not part of the if block. So therefore if this is false, then notice if it's false, we gotta go out here and print this statement. So this statement here is actually down here. So another parallelogram. And this one here is actually right here. Okay. And then down here, we end the program. So we start from here. Then so notice after we print this line here, we still print the end program. So that means after this, I still have to go and print this one. Okay. So if it's true, print this. And then after that, it's no more same as to run exit out of the if block and then print line 12, you do that down here. If this is not true, then we're gonna skip this branch in here. We're gonna go directly down to the end program and just print that out and with that. Okay. So very simple one where we did not process anything much in the else of block here. Okay. Now let's look at the other branch, the else branch. So I mean, by default, the else branch is optional. If you don't want to do it, use anything in that, you can ignore it. So the else branch would be, make sure that they are aligned in the same column if this belongs to that if. Be careful because I'll show you for example, if I have another if branch here, if true for example, and if you happen to do that, okay. And I'll put something like that. So this branch here belongs to this if. If you do this, then this LC belongs to this inner if. Okay. So be careful the indentation where this else clause is being used. Okay. So let's go back to that before. So now we have the else clause and you cannot leave a blank like that. Okay. You can't just do that. If you don't put anything there yet, maybe you haven't decided yet, what you can do in Python is you put the keyword pass. It pass means like, I'll come back to it later. So that you can continue executing your code without having to write any code. If you don't do that, it's not gonna let you. So for example, if I comment this out like this, and you see there's an error saying, that you have to have at least one statement in there excluding the comment. So again, if I'm not sure what I want to put in there here, I know that this is the structure I want to put the word pass in here and you can come back to it. So you don't have to put any actual code in there. Okay. So we know that that is the else clause. If that is not true, then we're gonna go to the else branch. So the first else here is always the false branch. Right. So what do we do here? Well, when we were to print another statement saying and one is smaller, or I say and two must be like it's larger. So we have a two very basic statements. And then, because this is independent, right? It's not part of the else clause or block. It's by itself. So you're gonna get either this or that and this last line, right? Always be printed. So in this case, of course, we're gonna see exactly the same thing. I did not change the design here yet. So it should still be the same as before. And it's larger. Now if I swap the sign, then now we're gonna see that. And two is now larger because it's no longer true. But we love running the else or the false branch. So this is the false branch. So in this example here, you have exactly one branch for true, one branch for false, and only one of those will run. There will never be both. There will never be none either, right? One has to run or the other has to run. So if you do want to do something for the else clause, this is again, kind of like a processing part and you do that, right?  Well, actually, before you do multiple branches, let's do the nested branch or the nested if block. Meaning you can nest other if statements inside other if statements or else statements because indeed in here, between here up to line 12, 13 is one block of code. So you can treat this space here same as the entire space in the global space, right? So one block of a code block, same thing here from here all the way down to line 19 is actually in this case, either I can't tell by either how the else clause or the global block out here. So let's say inside here, if indeed, maybe let's go back to this one here. If N1 is less than N2, we know the N1 is larger, but also want to see if N1 is positive, right? Or negative, for example. So we can also do another check in here. So let's do if N1, how do we check if it's a positive number? Very simple math, right? Great and zero? More than zero. More than zero, okay, yeah. So if N1 is indeed greater than zero, I want to assume that what's going to zero is, zero is also positive, I guess. Yeah, we can do that. So it's greater or equal to zero. In that case, this is positive. See for notes here, the comments here. Then we have another branch, we'll print N1 is positive, okay? So in this case, yeah, we're gonna see, we should see this statement and also this statement, we're not gonna see this, right? And there is no else clause inside here, as you can see. So we're gonna see the N program down here. So we three statements over here, okay? So we see the N is larger indeed and N is actually indeed positive. What if we do a negative, I'll put a negative 100 like that, right? So negative 100 is indeed less than a negative 20, okay? So this will be true. So we print indeed, no, I'm sorry, that's not right. Negative 10, right? So negative 10, no, that's not right. And two, okay, let's switch this around then. Let's switch the plus sign. So minus 10 is indeed larger than minus 20, that's true. So N1 is indeed larger, but when we get to this branch, right? It's no longer true because it's negative. So we're not gonna see this. So only see two statements like we had originally kind of. You see that we don't see the larger N program. So we did not include the other clause. So if you want to print a negative, then you have to do another else here, right? The L branch and print here and one is negative. So now we have a full if L statements nested inside the L branch. And then we can do the same thing for the other one. So we can copy that, put it over here. So now we have the other part where N2 is larger than would say is N2 negative or positive. So we put that down here as well, okay? So I had two nested ifs inside another if and else clause.  Trace it and follow the flow line. And then where it ends when you have no more statements to run. And now of course based on the indentation indentation of your code as well. So this case, if I change this operator around to a negative, I mean less than. So we're gonna go to the else, the outer else we call this is the outer if. This is the inner if is inside. And then the outer else as opposed to the inner else, okay? So this is not true.  So N2 is larger. In this case, actually is it true or not true? N2 is larger, less than N1. It is, this is not true. It's actually smaller, right? I mean, I mean, the wording is not correct. It's actually smaller. It'll be weird. So forget about what I typed here. It doesn't make sense. Yeah, it is smaller, it doesn't matter in this case. But we're gonna see that it's gonna be a negative or positive down here as well. So I'm just showing you the branches that it goes to, okay? When you deal with this type of scenario. So again, be careful when you do the else clause. If you happen to do that, and if you happen to like, and then this like that. And so now all of these belong to that single branch and you expect to run these, but then you're not gonna get the result. In this case, you're gonna get only a single statement because there is no else clause to run because this is not true, right? So be careful when you write your code this way. And sometimes in this case, is what's called a logic error, right? When you debug it because everything is correct. It's just the output is not correct. So logic error is very time consuming to fix. So going back, all right, so now we have the if and the else. Now, when you test something like this, when you're just testing for a single operation like this, whether this is true or not, is you can use if and the else right away. You don't have to test it again. Okay, so for example, let me move it down here. Okay, let's move it down here. Actually, let me copy this and I'll do another one. It's confusing, so let's do that one here again. So again, I'm doing the same thing. I say if and one, and let's go back to positive number. We'll just do a simple one. If anyone is less than and two, it would print, I just put here and one larger. Actually, we end two, end two larger. Oh, let's just end one larger, okay? So the else part, you can also, sometimes you can also do this, but you don't have to else. And then at the else clause, some people might want to check it again. So you can do if and one and two is greater than one. It's redundant, okay? What I'm showing here is redundant, okay? So this is redundant because I'm repeating myself because I don't need to check it again, right? We know for sure if this is not true, then it will have to be this one already. So therefore, you don't have to check if it's true again. Okay, it's just extra code to write. Of course, you're a producer, same result as the other one. And in this case, you can see that it is, and, oh, wrong syntax. So the end two is actually larger, that's true, okay? So by doing this way, what you can do though, however is, if you can check this if and one is larger than end two, if it's true, then you put that else, maybe if you check something not related, then you have to check it, right? If and one is not larger than two, but an else clause, then what? Then what do you check? What else do you want to check? Besides just comparing whether they're large or not, you can compare whether and one is negative or positive. Maybe if you do that row, since if and the one is greater than zero, then we'll say and one is positive, right? What else do you want to do? Okay, so that's true. And if you also want to say, well, if that is positive, then you'll do that. Otherwise, you go back to your else clause, matching this one, if it's not positive, maybe also want to check to see if and one is a point number or you're visible by our row two, even number, right? If it's even number, you do that, okay? This is the even number. And we print, do you see that? I have one condition. If it's true, then I print that I'm done, right? Program ends. If it's not true, then I go into test the next condition. So this case back to the choices of operation you want to do. Choice one, I want to see if and one is larger and two if it is then I end here. If it's not true, then the other choice is, is it a positive number? If so, then I print that and I'm done. If it is not positive, and I keep going to the next choice, is it an even number? If so, I'm done. And if none, all the above are true, then the program ends, so print nothing, right? So in this case, if you run it, you're gonna see it, and we just get the point where end is actually, no, this is not true because of the else clause here, okay? I had a wrong. I already had an incorrect program. Well, I guess that's fine because it stops here, right? It stops here, that's fine. If I put, yeah, if you put a number like a minus 10, like that, right? Then you're gonna get only one of these branches, right? So let's see if I do that. You see that it is indeed even, but it is not larger than two. It is not positive, but it is even, so you get one of those, okay? So this approach here is, as you can see, it's a little bit hard to read, hard to see. So instead of doing it this way, if I add one more statement, you see it's gonna go further and further to the right. Again, it's nesting that way. So what Python came up with is, has a what's called the else if clause that you can join this together like this. It's not two words, by the way.  So you have the call L if, okay? The L if here stands for the else and if clause. So that you can make your code much nicer and easier to see, as opposed to be all indented to the right and left. Do that, and then, and let's end that. Not sure what that came from, but, okay. So now, if you look at it, it's much easier to see. And they use the else if or L live here, only when you want to test a different condition from the one above. I mean, now they reverse the way. If it's a reverse of it, again, it's redundant. Okay, if it's reverse, you don't have to test it, but if indeed a different condition, then you can join those together using this approach. So we join the if and else if and else if. And the very last, we can also have another else clause. This is like the catch all. If none of the above is true, then it must be this one, right? If you have an else if, else if, you don't have an else statement, else clause. I mean, if none of these are true, then nothing gets run and you don't know whether they're true or not. So you can also use the else and then you print here a none of the above, right? Something like that. So you know that something is happening and the other three did not catch it or something. Okay, so this is a very common example. We have multiple branches or multiple choices in your conditions in your program. Is this a student, right? Is this a regular employee or not? Yes. If it's not then is this person above 40? Yes or no. Is this a senior, right? You can have all those different clauses go down there. So the order is important when you have a collection or a list of if and else if here because you have to carefully replace them in a logical order because if you do it correctly, then you may not get what you want. Okay. I wonder what example that is coming from one of the assignments that we did in week one. So in this case, you can see I should get a same as before and is in the even. And if I put like 11, then none of the above should be true. I should get this statement here because I know that it's not true. This is not positive. It is not divisible by two and it must be the else clause. So you get the none of the above, okay? So notice, I mean, just for like, you know, indentation-wise now each code block they must be starting the same meditation space of indentation here. The next block, it doesn't matter. You could have, you know, like that and this one here, you could have like, like that doesn't matter, okay? So wherever you start, the next statement must also start on that same position. So I cannot go back and put another print here, okay? It's incorrect. So they must all start from the very first statement whichever it is, how many spaces you put or indentation you have, the following statements must follow the same space. Again, the only time when you get to indent forward is you have another code block. So the colon here represents a code block and Python and I can't just do that either, okay? I have to have a condition of some sort another program or another will learn object later will get another class or function. Okay, so again, you don't want to do that. It's kind of ugly already. So just resort to using the correct same number of indentations your code is much cleaner. All right, there any questions? Okay, so we kind of cover already like the if and else and then else if clause and then the inner nested clause. Now, you can also do this, show you another one can also produce the same output is instead of joining these together like this you can break them up just if like that, okay? And then this would be the else clause. So I guess this is a little bit different. So we'll leave that up for now, okay? Okay, so if I go back to a 10, so let's see. So this case, you know, because only one if same as what would be true in this case will be the last one here because both of these are not true. So we go back to say and is even in this case. Okay, right, I produce the same output as before same result. So can anyone tell me what's the difference between this and what I had earlier with the LLIF? I have three, you know, blocker code using the LLIF like that, right? So again, they produce the same output it should be and is even as opposed to by themselves like this. Yeah, yeah, right, they're not nested into one the other, right? So, and they produce the same output, okay? So if I put a positive 10, I'm gonna get this one, right? I'm gonna get and is positive and is even because we have all these are true. So there's one difference there already, right? Okay, so I guess what I want to show you is that if you run it, if you type your code this way, that means each of these if block, if statements will run independently. Yes, like you said. The other one wouldn't be all the way up to the stage. The other stage is up to the stage. Yeah, yeah. I'll say, that's correct. So if you don't chain them together using the LLIF clause, that means every condition will be tested. Every if block will be contested will be tested. And sometimes you want to do that if you're, if you want to do is basically to select one option out of these, then you want to use the LLIF because what happens is that only one of these branches will run, right? So in other words, if you have 20 of these, you don't want to go through every if condition and test those, it's redundant. If only one can be true, then just keep running down the list until you find the one that is true and then ignore the rest of the code. So you don't have to spend extra CPU time calculating those extra if blocks. Okay. Yeah, it was skip. Yeah, that's right. Yeah. So you want to just skip it and then be done with it, move to the next process. So that is the difference between using an independent if and then by themselves or with the LLIF. So this is more of a design pattern. Okay. So here I give you a simple example. If I go back to the other one over here, okay? So back to this nested branch. When you have a nested branch like this, when this is true, only one this is true will this run. Okay. If you have a situation like this and what you can do is you can actually combine these together. Okay. So I'm going to copy this, create a new one. So we can try this again. And I will show you the first block here, probably this. So when you have this kind of scenario, you don't have to have another else if black in here. And I'm going to just remove that one or that simple like that. If this is true, then I'm going to test this to see if this is true. So in this scenario, what you get is what's called the end operator or a compound condition. So instead of doing that way, I can combine both of those together right up here and join them with the word end. Okay. So it's now past the same. So this statement can be removed. I can remove this one. And then put that over here. Okay. So that means that this has to be true and this has to be true as well. In this case, for both of these to be true. I mean, the logic is a little bit different. I print it in here, but I want both to be true. And one has to be larger and it has to be positive. In that case, then you can join those together like this. What's called a compound condition and using the end operator like that. So your code is shorter as opposed to having many if nested ifs in there. Okay. So both have to be true and then you've got to get that. So in this case, and it's indeed, this is not true. And then because it's not true already, it's false using the end operator. And with the end is that both have to be true, right? So if one of these is already false, it's got to skip the entire thing, right? Back to the truth table, right? So, and one is not less than two. So before it's already false. If I make that to be a positive 10, then yeah, this is, it's not true either. Let's make it 20, 22. Yeah, it's not true either. So both of you would never be true. I guess the way I had it, because it's, unless it's positive like this, back to that. Then this is fine, right? So this is true, and this is true, therefore, and is not a larger, but of course, it's smaller now. So you get a smaller positive end program. So I'm just showing you the end operator here, comparing this one first and then this one. So it's going to compare from the left to right. So if this is true, then only then will the next condition be tested. If this is not true, then the next block doesn't need to be calculated. So behind the scene, which you don't get to see, Python will not spend CPU time to calculate this part. Okay, so this is called, sometimes called the short circuit operator, like back to a circuitry, right? So you are shorting it because you would basically, I don't need to check this because it's only, this already one false. Everything would be false anyway. As opposed to the OR, OR means that if this is true already, then I can ignore the rest. I don't care what the others are, because as long as one of them is true, the entire thing is true, right? But if this is false, if this is false, then because I'm using OR, I have to check the next one. If this is false, also, I keep going if I have more to check until the end of that, or until you find one true result, and then it will go to that branch. And so that is the difference between the AND and the OR. So again, be careful which one you put first because that is going to take precedence in the program, okay? Okay, I think it's a good time to stop for a 10 minute break. We'll come back at nine o'clock and we'll continue on. I wanted to spend the next session to do some exercises from the book. So we'll continue, we'll come back for break. So I'll see you at nine o'clock. All right, so now let's see if we can spend the rest of the hour to do some exercises, okay? Also I want to, if you look at the notes, in my notes, so I can give you an idea what is it at? So we're here, this notes here, my notes I added a diagram towards the bottom of these. So again, I have some extra notes in here that may not be applicable to this course, but I do want to show you anyway. So when you do the operations, make sure that you're using the word AND as opposed to the ampersand here for the AND or in the exclusive for, okay? Because these behave differently. These are called, these are the binary and the binary or as opposed to the Q and and or. So if you do A and B, what happens is you're actually comparing the bits of the binary number as opposed to the actual value of your variable. So be careful when you do that. If you are from like Python, I mean, Java or JavaScript background, you may be more familiar with the double ampersand and double pipe symbol here, but Python doesn't have the two ampersands and things like that, just the word for AND. So again, just some operators here. Down here, I don't know if I have a note on, so this diagram may kind of show you what a nested if statements or condition will might look like in a float chart. So you have like different layer or levels of nested blocks in here. And, you know, it can be pretty deep down. So as you can see, it's much harder to draw in this case than to actually write pseudocode. So again, this is like the trade-off between writing pseudocode and float chart, but it does give you a nice visual of what's happening but it takes a lot of time to, you know, construct. But nonetheless, if it's easier to see things than, you know, you have to probably show just the approach, okay? Right, so I have, let me see, I have a poll that if you exercise it from the book, like, for example, we can try a few of these very simple ones. We can try the first one, right? Very simple. It says to, and let me copy this, okay? And then I'll put it to the spider so we can run that in here. What appears to we can see. So you're gonna write a program, right? Contains a number X and Y and to sets Y to X. If X is positive and to zero otherwise, okay? So a very basic question, very simple one, but if you don't understand what it's asking of you, sometimes you can have the wrong program, wrong code, right? So the first thing is you have to understand what is asking of you and what kind of output you need to produce. So this key doesn't say much about output, but it's expecting us to just print the value of Y, right? Y, is it X or is it zero? So in this case, I'm gonna read the output. Okay, so the input again, put here, it's easier to do things in a sequential order like this and put notes in here so you can see which part belongs to which part. I always kind of do like to do this so you can see it easily. So was the input here, right? So the input is we're gonna read X and Y. I mean, we're gonna read X, yeah, X only, right? Because we don't care about Y, Y will be either zero or X based on that condition, right? So initially I'm going to, even way before the input, we always know Y, so Y could either be X or zero. So if you just write it straight out, so the output, I know where it is. So output will be simple, print Y, right? Y is, and then put here Y, and I don't have Y yet, so I'll recreate Y up here, eventually I will. So let's do the input. So we'll print the input into X and we'll put input, remember the input function? Now we enter X like that. So very simple, right? You bring one value, and then the process is to decide whether Y is equal to zero or Y is equal to X. So how would I do here? What do I need to do here? So we'll test here, right? We'll test using the if condition, just like what it says here, if X is positive, and we kind of did this last time, so if X is positive, so again, don't use this zero or grade zero, okay? So X is positive, and we're assuming that, I guess positive would be not zero in this case, right? Because Y is gonna be zero if it's not positive. So we're assuming that zero is indeed positive, but I guess it doesn't matter because Y is gonna be zero anyway. If that is true, then we're gonna say Y is not equal X. If it's not true, then we set to zero. So this is the else clause, okay? So the else clause, because in this case, we care about Y, right? Whether Y is X or Y is zero. So this is a very simple one. You can see how I can do that. And when you run this, I'm gonna ask you over here on the prompt, and if I enter a nine, then I expect Y to be nine, right? Except I got an error, okay? So again, if you get this type of error, I told you last time that you have a lot of errors in your code and you spend a lot of time debugging, and this is one of them, because actually, oh, I forgot because you cannot compare a number against a string, right? Remember, every data coming in from the console to the computer to a program is always gonna be a string. So you cannot compare a value against a string. If you put a string of zero, then yeah, that's fine, because now comparing string against string, we kind of looked at this last week as well. So the type you're comparing must be of the same type, okay? So if I do this way, the asking value of whatever X is, is a string compared that against the asking value of zero, then now I can do that because it'll work, as opposed to the other one, it did not work. One more thing also I wanna show you is that notice how I run this program, I still have my old values variables up here, okay? I don't want these to be in here because if I do, and if I do some extra code or simple code down here, I can have some incorrect error, because I think the program here actually, it may, and it does or not, it may have some kind of interference with the value in RAM here. So what you wanna do is if you go to settings, I think in the settings, let's see if it shows up, under the, let's see, where is it at? Oh, I don't remember where. There's a place, if I can find out how, find the next time, there's a place that ask you to check a little box to clear the entire memory every time you run, forgot which one, oh, run, yeah, under the run here. And I want you to select this box, something about remove all the variables before execution, okay, so you check this box, and just apply or okay. So now when you run the program, it's going to clear this automatically and it will add only the variables that you have in this program, okay? So now it's much easier to see than before. So put here nine again, okay? So it only retains what I currently ran in my program. I suppose to retain everything before, okay? So you can see that now it works, right? Because of comparing of the same type. So if you were doing a number like this, I told you that you have to convert this to an integer first. So you can do it like this, X is equal to int X of comparing integer as opposed to a float. So now I'll compare numbers. So it's still be true, okay? When you do something like this, you know for sure that you're expecting a number, you can wrap this input inside here because this is in the X, right? It's like math. So X is that, X is in here, so therefore this is X, right? So you put that in here, like that. And then I've removed this. So you can see that now I have two things in the ones, but I've basically killed two birds with one stone, right? Like the same goal, okay? Because execution will start from the inner parentheses out. You're going out from the inner out most. So I read first and then I convert that and assign that to X in the one goal. So I mean, this is fine, but don't do this, okay? I'm not saying you cannot, you can. Some people will actually do this. Okay, if X is true, then I can put X here, right? And then I don't need this in here, okay? You can see how flexible this can get, but then it's confusing because, you know, we don't want to do that way, okay? So this is good. Convert it by the way. So I don't have to convert it again in the future. And this part here, if this is true, then Y is X, otherwise Y is zero. If it's not true, right? If it's not true as if I put it in minus seven, Y will be zero, right? So in this case, it doesn't matter what this is. So if I do this, if I move this and put it above here, I initialize it to be zero. So you can see, I ignore my else clause, okay? Because I initialize Y to be zero, that is the default value. The only time I want to change Y from zero is if X is indeed a positive number, right? If that's the case, then now Y is replaced and then it will execute down here and I'll get the correct result. So I save myself two lines of code. I mean one extra line of code basically, the else clause. So this is a very common pattern or coding style. If you know that regardless of what happened down here, Y has to be something, then what is that default value be? Is it true, is it false, is it 100? Because the only time that will change if a condition is set down here to modify it.  Right, so that was pretty simple, right? Okay, just don't forget conversion. Let's do the next one. This one is basically asking you to write a program to read an integer, okay, we do an integer only, and prints how many digits the number has and I'll give you some hint here. Checking whether the number is greater or equal to 10 equal greater or 100 and so on, assuming it's less than 10 billion, because we don't want to do too much. If the number is negative, then you multiply it by negative one to make it positive, right? So we only deal with positive value. So this is like a condition, a validation part where it doesn't matter, a user enters a negative or positive number, we always force it to be a positive number. So you have to take this to account as part of the requirement in a program. You can't actually ignore that, right? So same as you're reading a spec to build something, you have to read everything and make sure they meet all the criteria. And it said the order of if statement is important here. You'll give some hint here, okay? So let's copy this into our program and now we'll do this one, okay? So again, input. Hey, wasn't I keep doing this is because you want to output everything only at the end. You don't want to go and process, output, process, output as you go. We don't want to do that, okay? Unless you have to produce some kind of error, then that's fine. But don't print the result here. Process everything, save it to variables and then print at the end. So it's very clean and restructured. Okay, so the output is, of course, we're going to print the number of digits for that number, right? So I can put something like this, print a number of digits and then I'll put something and we'll put a variable right here, okay? So we just look for one number. So we'll just get the input first. I'll put here just num. Again, we want to be integer. So we convert right away, okay? And then with the input, we enter a positive number to put. We ask that from the user and in later program, you can force a user to enter a positive number when we learn about loops, okay? But in this case, we add, we ask that of course people always want to go the opposite way, right? And we accept it anyway. So enter a number and then it says, if the number is negative, we want to multiply by negative one, okay? Even though this statement comes at the end of this exercise, you have to read everything, make sure, okay, which one should I curve first? That's why I put a note saying that the structure of the if block is important, okay? So if it's a negative, then we want to do that first, okay? We don't want to calculate negative values, basically. So the process is actually down here now. We don't, the input is very simple. So we check for negative number, okay? So we say if num is indeed negative, less than zero, right? If it's negative, then we want to multiply by one, negative one, right? So num, multiply by one, right? Oh, minus one, yes, sorry, good catch. So n times minus one, I sign back to n, basically. Okay, so this is the same thing I was saying. Num is equal to num times minus one, okay? So the shortcut we learned last time. And then that's it. So we don't have the else, we don't need the else plus because it's either positive or already be forced to be positive. That's the first process. And then now we go ahead and then figure this out. So this part here, how many digits does the number have is the algorithm you have to design. So it has, and there are many, many approaches to this problem, this type of problem, of course. So what will be a solution to this? If I enter 10, then it's a two digit.  How do we figure that? Any thoughts? Minus, minus 100, minus 100, yes. Well, I mean, if it's a minus 100, then we'd be forced to be 100. So we don't have negative numbers, but if number of digits would still be, if it's 100, then you get three digits, right? One, zero, zero, that's three digits. If it's a, right, so how do we know if the user enter like a number like that? How do we know how many digits is that? Yeah, there's a link function. Okay. So you can use that link function, but I cannot do length of one, two, three. It's a check, it's straight. This is not a link function, it's actually a string. Yeah, you can check, it's not a link function, it's a string, check it, then you type it the other way. That's all. No, that's right, yeah, that's good. Right, that's why I say a lot of approaches, right? So absolutely, yeah, you can convert to a string and then use a link function and do that, right? Because if I do this, then of one, two, three, four, I'm gonna get that four digit back, right? So yeah, absolutely, oops, so you get a little four, yeah. Okay, you can do that more because the reason why we have to do this, convert to integer is because if it's a negative number, we have to convert it to a positive number. And then after that, because it's now a number, like your approach is to convert to a string, right? So we're, so we can do it. Not a little bit of a problem. No, that's right, there are lots of ways, right? That's why it's so fun. So we say a number is convert that back to string. So now it's a string and then we can do the size or it equals, I guess digits equals the length of number, okay? And then finally we print them here. You say a number of digits is put a comma here, okay, digits. So yeah, that's one approach, absolutely. And we'll see if it's correct. Enter a number, enter 12, I expect that to be two and it is two, it's good. If I enter 9999 as four, so we get four, perfect. So that's one approach. What else can you do? What's another approach? So again, this is algorithm, right? So this part here, this one works because, and Python in some languages have these functions that you can convert, right? But some programs may not have you give you that option. It doesn't have the conversion. So if it's just numbers, how would you do it? So another approach would be, well, you could say, you could think of this way. I mean, this example gave you a clue here. If the number is greater or equal to 10 or 100 and so forth, right? So you can think like anything below 10 is one digit. It doesn't matter which one. Anything between 10 and 99 is two digit, right? And if a 102999 is three digits and so forth. So you have that range as well. But you're going to have more if statements to do that, okay? So that's another approach you can do. So this part is good, good as is. So we'll comment this up for now and we'll do the other approach. This one here, and by doing this way, then you don't have to use the if and else statements. Since the chapter is about if and else, we'll do with the if and else, okay? So you can say that if the number is less than 10, right? Then we'll say digits is two, right? And then else, if the number is less than 100, actually, we did at least a little while. Oh yeah, that's right. Good catch. Thank you. So it'll be two, and then you can keep going, right? I'm just going to stop here and then we just is three, okay? So you can see how this logic is also work. If I go up to 999, it's going to be three digits. If I put anything in between, like in a one, two, three, oops, over here, it's still going to be three because it falls into that range. If you put a 2035, you get two, okay? So that's another approach using numbers without doing any conversion, okay? Yeah.  But later when we learn loops, you're going to see that it's actually much shorter. It can do this in two or three lines of code. Up to a number, right? But now that's, so this is like the very basic, one of the basic algorithms that you can do. So this is one approach. You can do that. What was another approach we think? Another approach you can do is using the very powerful operator in Python, the double slashes, okay? So if you have time to review, for example, if you do something like this, but to, like, let's see if this works. So if I do a 10 divided by, for example, divided by 10, I get a 1.0. That's the decimal value. If I do a 10, the two slashes of 10, I get a 1, right? If I do a 100 divided by 10, I get a 10 and so forth. So this operator here is quite powerful to do some of these operations. So one of the exercises that you did in the assignments, you asked me to how many types of denominations can go into the $100 and 50 bill and $20 and so forth here. So for example, if I ask you, if I enter a 125, how many $100 bill can I go into that amount? Is you can do that by divided by $100 bill. I can only fit one single $100 bill, right? Okay, if I put like six like that, if I do that, I get, I'm gonna get $5 bills. So another very powerful operator to do that as well. And if you want to know, okay, so how many $20 bills can go into 568, 568 here? I put here 20, I can get 28 $20 bills. So another approach you can do here is a little bit, I've just shown you like different way of how to do this, see this works, another approach using this operator, okay? So we know that and is that already? So what we can do is I'll start, so initially we'll put here digits is defaulted to one, right? So regardless, you're gonna get at least one. The smallest digit you can get is one, right? Between zero and nine. So that is the default. And then I read my number and what are the number is, it initially was N. So I could do something like, maybe I put like a S or something else just for the sake. So S can be a num divide by 10. And what you can do is that you keep going down until S is actually zero maybe, I'm not sure. So if I do that, let's say if it's like 25, right? 25 divided by 10, so I'm gonna get two, okay? So the result is two, so S is now two. And then if I put two divided by 10 again, I get zero, okay? So I keep doing that until I get a zero basically. So if S is not zero, if S is not equal to zero, okay? Then I keep doing that approach. So I keep doing like S using itself is equal to S, right? Divide it by 10 and then I count my digits by one. And then you keep going. So basically you're gonna end up this block. So again, it's not, I mean, I mean, the best approach by showing you that by doing this way, we'll see this one, I'm gonna just go to three layers here and see what happens. So if I enter like a 25, right, I get two digits. Because at that point, when I reach here, S is only zero, so I get a two. If I do a 125, I got a three digit, okay? So you can see this approach also works, right? It's a little bit more like math, but these operators are actually quite powerful when you use it in the right manner. So I can see there's a lot of ways to do this approach program, which is quite fun, right? You're programming like this math. And again, later when you learn loops, you can just basically use these two lines and then you can solve the problem with one additional loop structure, okay? Because if the number is really huge, then after keep going, keep going until, like the answer's question says up to a billion, right? 10 billion, and that's quite long, but just showing you the FNL structure here. So what I did here, I kind of met, you see, it's like I'm nesting this thing here, which I don't have to, because if this is true, then I update my S and update my digits. So this could actually go back over here, and it should still be fine, okay? So I think that should still be okay, because basically I update this, and if it's only zero, then none of these will run like we did earlier, right? As opposed to nesting this together. I'm just gonna have a lot of repeated code. That's what we, when next chapter we learn about loops, it's so important to, you know, avoid this type of program. But if you don't know them yet, either keep going until you find it, okay? All right, so that was kind of interesting and fun. And this one here, I guess we can skip this one here. You can try that one, letter grades. I wanna try this, let's try this if nest that one. This is like a board game, right? A chess board or checker board. The program is each square of the chess board can be described by a letter in a number, like columns A through H and rows one through eight, I guess. And so I guess you want to find out, I don't have the suitable code here, I guess, but how do you know if I land in a, you know, spot, like G five, like row column G, row five, this block here, how do I know if that is a gray or white? Basically the color of that position. How would you write a program so that I can pick any spot here and it would tell me, you know, gray or black or white? What do you think? What kind of algorithm would you come up with to solve this problem? Again, lots of ways, right? Lots of ways. So what do you think would be a solution to this? So we ask the user to enter, you know, like, for example, G five. So we assume that A through H and then one through eight only. So if I enter G five, and then what is that color of that cell? So how would you determine? So right, so before you write any code, you have to come up with an algorithm, right? How do I figure if I land in an E six, what is that? Right? And of course, this is a much simpler program, but because the checkerboard is very structured, right? It follows a single pattern, a common pattern.  If you look at each row, you see that it's alternating, right? White, black, white, black, white, black. Same thing with the row. So if you study this diagram, you see that, right? A eight is white. A seven is black. A six is white. And so you can see that for column A, all the positive numbers are white, right?  The odd numbers are black for A. And then B is the opposite of that, right? But then you see that, okay, well, A and C and E and G are the same. And then B, D, F and H are the same. So now you have some idea, right? So if the first number, the first letter is an A, then, ah, okay, I have some option to choose. Then the next is the digit. If that digit is the positive number, I don't care which one of this is. If it's an even number, then the color is indeed white. If it's odd, then it must be black. And that is same. It's also true for C, E and G. So now you say, okay, well, if it's A, C, E or G, then check the number. If the number is even, then it's got to be white. Otherwise it's black. Okay, so that's one way of approaching this solution, right? So if I look at that and then you can read it into, I guess, pseudocode and flowchart if you want to. So we can, you know, say that, so if the row, let's say if the first letter is an A, C, E or G, right? If it's that group, I'm using like a Python syntax, then now we check the number, right? So if the second letter or second character, because when you do this, you can read it as the entire thing as a character, right? One approach as a character is, or I guess the second, I can just say if the digit, if the digit is even, then, right, color is white. Otherwise, color is black. I guess that was solved for the columns A, E, F, A, C, E and G, right? Else, this is the other else. In this case, I don't have to specify again else if it's B, D, F, G. That's already the other approach. The other ones are ready. So it must be one of the other ones. So I don't care to specify them in here. It's the else clause already, right? And then now I have, all I have to do again is just test for the digit, right? So if the digit, for that case, and this case is the opposite. If it's, if you look at B, if it's an even, then it's black and then the other is white. So basically the reverse of that, right? Else is white. So that is a pseudocode for this one, right? So you want to get a pseudocode. Now you can go in, write Python code, right? So, so design the algorithm first and then test it. So we can quickly copy this and let's go to spider and see if this thing works for right here. Okay, one more time here. We can just basically reword this. So first the input, I put here cell. I put here input, enter cell. So, so we know. And we're going to treat it as a string. So we can grab the first position and then the second position of the string was assuming that's going to be two, two characters. Okay. So if the first letter is ACG. So I'll put here. So the first letter in this case of the cell of zero. Okay. It's a zero based language. So if I enter a G five, the first is the letter G. If the letter G is indeed a letter A. And I can't just do this. Okay. A, C, E, I can do that. You have to do, you have to use the whole thing. If that is that for cell of zero is equal to C. Right. Or cell zero is equal to E. And then one more for a cell of zero is equal to G. So I have the entire list there. If that is true, then go ahead and do the next one. Now, if you had the second digit. So if the cell of one is invisible by two. Right. I mean, I'm not to is equal to zero. It is positive. But remember it is a string. So you have to convert it to integer. And you can do that right away. You want to go like this. That convert that into int. And then convert first, right. And then divide that by two. If it's zero, that is positive. If it's positive, it will set the color to white. Otherwise color is black. If that is the case, then down here, I basically kind of repeat this again, but I switch the other one. It's going to be black. White. Okay. And then finally, what would I output here will print the color. And so basically this is the processor. So I can see processing is much longer than the end quote. So this is case sensitive also. If I enter a capital A, it's not going to work. I'm just going to give you, give you that right away. So we'll see if this one runs. I'll put g5. G5 is black. Is it true? G5 is indeed black. That's to a C6. It's white, right? So C6. White. So it's working. But again, if I enter a capital C6, then it gives me a black. Right. It's correct. So you have to be careful when you compare these. Okay. You have to convert it to either all uppercase or lowercase, where sometimes you do the hard way, you have to do this. And it's a very, very tedious for equals capital A. A can see it's a lot to do. You don't want to do that. Okay. So what you do is you convert it. You force it to be either uppercase or lowercase. When you read this, you can do something like this. Convert everything to, I think, is it upper? I don't remember. I think it's going to be the end. It'll be upper like that.  If you want the lowercase, you call the lower function. It's a function that attached to this property. And then you convert it. So in this case, it doesn't matter what the case is. It's going to be a lowercase. If that's the case, then I compare all my values against the lowercase only. I can ignore the uppercase. Okay. I can choose one. So now if I do again with a C6, capital C, it should be white as before. Okay. So that's one approach. Now I'll do one more. I'll show you before we take this block here. You can also do this by using what's called the in operator. Similar to SQL. SQL. You can say if C, if the cell in C1 is in these numbers, like A, B, actually it's C, E, and G. You can also do that. Again, it's a shortcut. This has to be in here. I mean, it has to match one of these. So again, we'll do a G5. Okay. So that also makes it a little bit shorter. So the in operator compares this value on the left against a list of, in this case, a characters. I'm using here is a list. We will learn that in chapter six. Or you can also do is you compare that in a string as well. So it's a substring of these. A, C, E, G. Okay. It also works because it is, this is a type of container data. So you will compare against each character in that list of characters. So if it's, if it's an A, C, E, G, then that will be true. In this case, if I put C6, I get a white as before. Okay.  So this is indeed in four. Okay. Good night. And I will see you all next week.


And here we are with the warriors that go out there to fight the wolves, right? It's not like they want to leave their comfort zone. They'd probably much rather sit in their tent and drink some beer. But there's something that matters to them and that is protecting the village. And so can they go out there even though they might have some self doubt, maybe even though they're in a critic speaks up, right? Of course, because it's so, so freaking important. What's up everybody and welcome to the show today. We drop great content each and every week and we wanna make sure that you guys get notified. And in order to do that, you're gonna have to smash that subscribe button and hit that notification bell. And if you've gotten a lot of value out of this, make sure you give us a like and share our videos with your friends. Now over the last few toolboxes, we discussed becoming a powerful communicator, which is step one in our unlock your X-Factor formula. Now what we mean by X-Factor, if you've been following the show, is how do you go from ordinary to extraordinary? What is that factor that makes you extraordinary and allows you to reach the success and potential you know you have? Now over the last year, we've asked all of our show guests what their X-Factor is and we've taken all of those responses from super successful guests and distilled down what we believe are those necessary steps that you have to take on your path to unlocking your X-Factor. Well today we wanna talk about step two, becoming unstoppable. Once you're a powerful communicator, well the only thing holding you back from taking that next step might be your own mind, fear, insecurity, self-doubt. So today Michael and Johnny are joining me to break down how we can become unstoppable and have the confidence to face down those fears and reach a state of freedom where we can take action in any area of our life that we truly desire. Now we have some myths to discuss around building confidence. You're not alone in having self-doubt and unfortunately our evolutionary biology and modern mainstream media are working against us and after we dispel some of these myths around what it takes to truly become confident, we're gonna break down how you can start taking action today to become unstoppable. But first let's jump into what is the biggest reason that many of us are struggling in the confidence department, letting our fears keep us on the sidelines? I'll actually put a number there. So I would say that 95% of the people out there struggle with confidence and they're trying really, really hard to develop it but they're using the wrong tool to fix the wrong problem. It's almost like whenever I work with someone that has been trying to work on their personal freedom on their confidence for years, it's like they have a shovel and they're digging a hole and all they can do is like speed up and shovel harder and the first thing I tell them is like stop, like put down the shovel. Let's try something completely different. Here's the big misconception about confidence that people have. People think rightly that confidence is a feeling and when they have confidence, it's easy to be free. It's easy to speak to everyone out there. It's easy to ask that person out. It's easy to go for that job offer when I have confidence. So here's the solution they very cleverly find for themselves. I have to find confidence first and then everything else becomes easy and then they spend years and years and years waiting for that magical moment where they have confidence and it never ever comes and the first, we can actually try this out if you tour up for it. The very first exercise I do with everyone who's going through become unstoppable is I ask this question, imagine I have a magic wand here and I can point this at you and magically you have 500% confidence. Like it's unlimited, it's unlimited confidence and what would you start doing and what would you stop doing? Like AJ, let's pick you, right? You're my go-to example guy today. What would you do differently today if you had unlimited confidence? I'd be speaking on more stages. So you would be as to what you would be doing differently and today I would assume you would apply to speak on more stages. Like after this interview here, after our chat, you'd be on the internet and you'd be looking for opportunities to go up on stage. Now here's the thing, there are three things. Whenever I do this example, this shows up without exception. There are three reasons why people can't do that right away, why they actually need that magic wand. The first reason is they have a lot of thoughts that get in the way. Self-doubt, the inner critic, the perfectionist. They have emotions that get in the way. It makes me feel stressed out. I'm afraid, I'm anxious. And they have a lack of skill. Now I tell them, look, the skills, I can't let that count because unless AJ, you get up on stage, unless you start pitching yourself, you won't get the skill anyway. So we're left with my thoughts get in the way and my emotions get in the way. So AJ, here's the thing. I don't have a magic wand. Like I'm actually holding up like a pen here. I don't have a magic wand. But if we manage to help you deal with those thoughts that get in the way and let's not fool ourself. Like thoughts really have the stopping power of a brick wall. Like it's tough to really deal with them. But if all that stands between you and that unlimited confidence AJ, are your thoughts and your emotions? Like come on, like, you know, let me show you some techniques to deal with them.  Does that make sense? And that's what people don't get. Like they would say, Michael, first I need to be confident and then I can send out all those pitches and then I'll be on stage. And I'll be like, no, first you need to be on stage and then we can talk about you developing that skill and that confidence. And what I want to point out here that many of us again assume about others that we see as being confident or unstoppable, is that they don't have those doubts, they don't have those thoughts, they don't have those emotions. So many of us just feel if I can control my thoughts and focus on the positive and give myself affirmations and tell myself over and over that that doesn't matter, I can unlock confidence. And we see it time and time again that that doesn't work. When you are trying to control your thoughts, control your emotions, not only is it a ton of effort and energy, but it still doesn't work at the end of the day, which is why I love when we're interviewing all of our guests, when they express that self-doubt, when they share with you, they do it anyways. Yes, they feel it. Yes, they think it. Yes, imposter syndrome is there, but they take action anyways because they have goals more important than those thoughts and fears that are holding them back. I think this goes to a long way of showing the celebration and the hype and pep rallies for people who try to hype themselves up to do things that they are going to find difficult or walking into the unknown or uncertain about.  Now, did they have confidence in themselves in their training? Well, they certainly did all the training they needed to do to go in there and be a formidable opponent, but they still needed to hype themselves up because they were walking into the unknown. Anything could have happened and there needs to be something to get you excited to walk in when everything inside of you is telling you you're not ready, you can't do that. What if this happens? What if that happens? Because we all have to deal with the inner voice that is trying to keep us safe. We drop great content each and every week and we wanna make sure that you guys get notified and in order to do that, you're gonna have to smash that subscribe button and hit that notification bell and if you've gotten a lot of value out of this, make sure you give us a like and share our videos with your friends. Johnny, you make such a great example here with the warrior, the small tribe that maybe gets attacked by wolves and the warriors pump themselves up and they go out there and they fight for their loved ones, for their village because here's the thing, when you look at confidence as a term, you find a lot of different definitions because it's not that clearly defined in the academic literature. The way that I use confidence in Become Unstoppable is you're outside of your comfort zone because inside your comfort zone, you don't need confidence. So you're outside of your comfort zone, you do what matters despite the difficult thoughts and feelings that come up and here we are with the warriors that go out there to fight the wolves, right? It's not like they want to leave their comfort zone, they'd probably much rather sit in their tent and drink some beer but there's something that matters to them and that is protecting the village and so can they go out there even though they might have some self-doubt, maybe even though they're inner critic speaks up, right? Of course, because it's so, so freaking important. Well, and certainly if they sat around waiting for themselves to get fired up to go take on this challenge, they could be waiting for a very long time and as we've said many, many times on this show that hope is not a strategy. So hoping that tomorrow I'm ready for this is a full Xeran, right? We're hoping that I'm going to be blessed to go out into the field and take on the wolves or whatever that challenge might be. And that, I can't wait, that's such a good point on it because I had one client at the end of the course for those many weeks of working together, he said to me, you know what, Michael? What I've learned first and foremost is that I can't wait anymore. I want to feel free now and I have to take action now. Whether I'm completely ready or not, I want to be free now. And the key distinction here is that emotions are fleeting, both positive and negative emotions. You know, I grew up playing high school football and I had those pep rallies and we would get fired up to take the field. And then the first time I got tackled, that emotion went out the window. So if you are planning on just riding this wave of positive emotion and positive thoughts off into the sunset to reach your goals, well, what happens when that emotion wanes? What happens when you get knocked down on the football field? That's the key here. That's what we mean by becoming unstoppable. Sure, everyone's highly motivated after a pep rally. Everyone can feel really good in that moment. But as we know, everything that you have sought after in your life thinking, this will make me happy. How long did that iPad make you happy? How long did that new house make you happy? How long did that career change make you truly happy?  No, that's not how life works. So difficult emotions, fear, is going to be a part of your journey. That is where the rubber meets the road. And when you have the right tools and the right mindset to tackle those difficult emotions, that's when you have the freedom that Michael's talking about, to change careers, to approach anyone, to travel the world, to go after what you want in your side hustle, to tell your family what you truly feel. That's what we mean by becoming unstoppable. It's not waiting for the right moment. It's not finding the motivation. It's not getting into state. All of those tricks and tactics and hacks that you've tried before, that's why you're here. And the science shows that, yeah, those will get you small results. Those will get you moving, but that's not gonna reach the big goals that we know you have, that untapped potential that you can't wait to unlock. So, as we were saying, this is about getting outside of your comfort zone. We don't need confidence in our comfort zone. We have tons of confidence in our comfort zone. That's what makes us comfortable. But it's what you do outside of your comfort zone that is what's important when we talk about becoming unstoppable. So, an example that I use with exactly that, like with your emotions, like relying on your emotions before you're able to do something, an example that I like to use there at the very beginning of the course is this idea that most of us, as we go through life, we're sitting in the passenger seat of a car and say that maybe we want to go from LA to Las Vegas. I don't know why these two cities popped into my mind right now, but let's say you're in the passenger seat of a car and you wanna go from Las Vegas to Los Angeles or the other way around and your thoughts and your emotions there at the driving wheel, there, there. So, your job as a passenger, how do you travel? Your job as a passenger is to make that driver think the right stuff and feel the right stuff. And if you can do that for a little bit, then for a couple of minutes, you're moving in the right direction. If you're not, then you're heading off the road. What we're doing in become unstoppable is I let them switch seats and I say, how about you're going into the driver's seat and you grab the wheel and you put your foot on the gas pedal. Now, here's what you need to expect. That passenger, your thoughts, your emotions, they're going to give you a lot of trouble. They're going to be the most nagging passenger you ever had in a car.  Now, what most people will want to do is they say, okay, I'm willing to grab the steering wheel, but then I'm going to wait until that nagging passenger gets out of the car and then I turn the key, in which case I tell them, well, call me again in 10 years and see how that worked. But if you're willing to make that important drive because you actually want to go to Las Vegas or Los Angeles and it's important to you, are you willing to make that drive being fully in control if what you have to kind of live with at the very beginning is that this nagging voice is going to sit there. And that's what we're training in psychological terms, this is called expanding the behavioral repertoire. So this is how it works. And I think to many of our listeners, bear with me for 30 seconds and I think there's going to be a big click in your head. Let's say you are at a business meeting and the numbers are great, your boss just praised you, and in that business meeting, you have what's called a white behavioral repertoire. And you can tell a joke, you can ask a question, you can stretch, you can get a glass of water, you can write some notes, right? Because you're happy, you're relaxed. But if in that same situation, you are very tense, very anxious because the numbers aren't good and your boss has just criticized you a little bit. You have a very narrow behavioral repertoire. And maybe the only thing you can do is stare at your notes. If it's insanely narrow, maybe the only thing you can do is think, I need to chill out, I need to chill out, I need to chill out. And now people will come to me and they say, Michael, I have the solution. All I need to do is I need to relax because when I relax, I can do everything. So how do I relax? And my answer is like, that's not how it works. How about we do it the other way around? How about you do feel a little bit anxious, nervous, stressed, but you do go for that glass of water and you do ask that question. And maybe you do stretch a little bit. Maybe you even crack a joke, even though you don't feel like it. Now what happens, your behavioral repertoire opens up and your mind goes like, wait a second, I just told the joke. I can't be anxious. I can't be stressed, come on. I just got up to get a glass of water, right? But that's the way, that's first doing the action, first taking that driver's seat and then taking it from there. And it's putting belief in the fact that that negative emotion, that fear will also pass. Just like positive emotions can't stay there as much as we try and hope. Negative emotions, doubt, self-doubt, criticism, fear also will not stay there when you are taking action. So it's flipping it on its head. It's not get the emotion right, then take action. It's take action with a belief that the emotion is gonna come. And all of a sudden you start wiring your brain to seek action in these areas. Step a little bit further outside of your comfort zone. Step through that self-doubt. Step through that fear. And now what do you have the other side of this? You have experience. And those experience points translate into confidence points. And I've shared this on the show a few times. I'm trying to learn how to play golf. And of course, when you learn a new skill, what do you do? You're on YouTube, you're watching TikToks, you're getting all the tips. You're amassing all of this knowledge. But knowledge doesn't translate to confidence on the golf course when you actually have a club in your hand and a ball that you have to get on the green. So how do we actually develop confidence? It's not about overwhelming yourself with information. It's not about listening to that next podcast and hearing about someone else doing it. It's not watching that next video and visualizing yourself doing it. It's the experience and the ability to step beyond the fear that allows you to actually become unstoppable in any area of your life.