Now in the last lesson we looked at how we can use comparatives, such as greater than or is equal to, in 1
order to send a different alert to people who got love scores above 70 and those who got below 70. 2
Now, what if we could find tune that even further? What if we could say, if somebody got above 30 but 3
below 70, then they should get a different alert from the other scores? 4
Well to do this we would have to combine our comparatives. And the three basic comparatives are two ampersands 5
for 6
AND, so whether if condition one is true and condition two is true. You can check to see if either 7
condition one is true or condition two is true 8
by using the 9
OR command, 10
and you can do this using two pipe signs, and that's the straight lines that you see on your keyboard. 11
And finally, as we've seen already, the exclamation mark means NOT, or the opposite of something. 12
So let's take a look at this in practice. 13
So, in between the if and else, let's say we added another if statement and we said, if the love score 14
was greater than 30, 15
so this is condition one, and we combine it using the AND, which are two ampersand symbols on the keyboard, 16
and the second condition is love score is less than or equal to 70. 17
So under this condition we can give people the alert of their love score. If the love score was greater 18
than 70, 19
we tell them that they love each other like Kanye and Kanye, and if they got a really low score, if love 20
score was less than or equal to 30, then we tell them that your love score is this and we give them 21
a different message, 22
for example. So now when we run our code, depending on what we got as a random number, then it will 23
execute different parts of our code. 24
So say if we got above 70 then we get the Kanye loves Kanye. 25
If we got between 30 and 70 then we just get the simple love score, and if we get below 30, then we get 26
told that you go together like oil and water. 27
So this is achieved by using a bunch of if statements that check whether if different conditions are 28
true at the time when we run the code and then we use comparatives to compare the value of a particular 29
variable against another variable or another value. 30
And finally we used combo moves like the AND in order to check whether if two different conditions 31
are both true at the time of checking.