Conditionals
Lesson 1 of 1
  1. 1
    We make decisions in everyday life based on conditions. If we’re tired, we might take a rest. If we’re thirsty, we would find something to drink. If we’re hungry, we grab something to eat. And if …
  2. 2
    As we previously mentioned, we do things based on our present conditions. Like, if we’re hungry, we’d get something to eat; if it’s raining, we would carry an umbrella. How our actions follow the…
  3. 3
    Imagine a scenario where we’re thirsty and want to drink some lemonade. But it turns out all the lemonade was sold out. If we followed our original plan exactly, we wouldn’t get anything. But it’s …
  4. 4
    Let’s now expand the use of our conditionals to account for other types like: πŸ”€, or πŸ”’, or πŸ’―! But there’s a question of, β€œhow do we convert the types πŸ”€,πŸ”’, and πŸ’― to πŸ‘Œ values?” Well, that’s where the …
  5. 5
    In addition to πŸ™Œ operator, Emojicode also offers other comparison operators to expand our use cases! Here’s a list of the comparison operators: Operator | Operation β€” | β€” ◀️ | Less than ▢️ | Gr…
  6. 6
    So far we’ve only been able to check a single condition in our β†ͺ️/πŸ™… statements. But, we actually check more conditions by using the πŸ™…β†ͺ️ statement. Like the β†ͺ️ that starts our conditionals, the πŸ™…β†ͺ️ acc…
  7. 7
    Consider the making of hard-boiled πŸ₯š. We need both: boiling water and an egg. If even one ingredient is missing, we can’t make it. So we should check for both conditions before we flex our culinary…
  8. 8
    Another helpful logical operator is the πŸ‘ operator. The πŸ‘ operator also checks two expressions and returns a πŸ‘Œ value. The major difference is that the πŸ‘ operator returns πŸ‘ so long as a single expr…
  9. 9
    In Math class, we might have been asked to solve equations like: 2 * 6 + 10 / 2 If we read out our equation from left to right we might think that the answer is 11. However, it’s actually 17 be…
  10. 10
    Great job getting through Emojicode’s conditionals! In this lesson we went over: * The β†ͺ️ statement accepts a condition and executes a code block if the condition is πŸ‘. * The πŸ™… statement provides a…

What you'll create

Portfolio projects that showcase your new skills

Pro Logo

How you'll master it

Stress-test your knowledge with quizzes that help commit syntax to memory

Pro Logo