S0-SA3-0665
What is Else (Otherwise)?
Grade Level:
Class 2
Logic, Computing, AI, Algorithms
Definition
What is it?
Else (otherwise) is a word we use to describe what happens when a condition is NOT met. It tells us what action to take if the first choice or rule doesn't apply. Think of it as a 'plan B' or an alternative path.
Simple Example
Quick Example
Imagine your mother tells you, 'If it rains, take an umbrella, ELSE take your cap.' This means if rain is happening, you take the umbrella. Otherwise (if it's not raining), you take your cap instead.
Worked Example
Step-by-Step
PROBLEM: You want to buy a samosa. The shop owner says, 'If you have exactly 10 rupees, I will give you one samosa. Otherwise, you cannot buy it.' Do you get a samosa if you have 8 rupees? --- STEP 1: Check the condition. The condition is 'have exactly 10 rupees'. --- STEP 2: Compare your money (8 rupees) with the condition (10 rupees). --- STEP 3: Is 8 rupees exactly 10 rupees? No, it is not. --- STEP 4: Since the condition is NOT met, we follow the 'otherwise' rule. --- STEP 5: The 'otherwise' rule is 'you cannot buy it'. --- ANSWER: No, you do not get a samosa if you have 8 rupees.
Why It Matters
Understanding 'else' is crucial for building smart systems because it helps computers make decisions. From simple apps to complex AI, this concept helps engineers and scientists create programs that respond correctly to different situations. It's fundamental for careers in software development, data science, and robotics.
Common Mistakes
MISTAKE: Thinking 'else' means 'always do this'. | CORRECTION: 'Else' only happens if the main condition is false. It's a backup plan, not the main plan.
MISTAKE: Not having a clear action for the 'else' part. | CORRECTION: Always define what should happen when the first condition isn't true, even if it's 'do nothing'.
MISTAKE: Confusing 'else' with 'and' or 'or'. | CORRECTION: 'Else' is about choosing between two paths (if A, then X; if NOT A, then Y). 'And' and 'or' combine conditions.
Practice Questions
Try It Yourself
QUESTION: Your friend says, 'If you score above 90 in Maths, I will treat you to an ice cream. Else, you buy me a juice.' If you score 85, what happens? | ANSWER: You buy your friend a juice.
QUESTION: A traffic light rule: 'If the light is red, STOP. Else, GO.' If the light is green, what should you do? | ANSWER: GO.
QUESTION: Your online shopping app has a rule: 'If your total bill is more than ₹500, you get free delivery. Else, delivery costs ₹50.' If your bill is ₹499, how much is your delivery charge? | ANSWER: ₹50
MCQ
Quick Quiz
What does 'else' help us understand in a rule?
The only thing that will happen
What happens when the main condition is true
What happens when the main condition is false
How to make two conditions true at once
The Correct Answer Is:
C
Option C is correct because 'else' specifies the alternative action when the initial 'if' condition is not met or is false. It's the path taken when the first choice isn't possible.
Real World Connection
In the Real World
When you use a banking app like PhonePe or Google Pay, if you enter the correct UPI PIN, your payment goes through. Else (if you enter the wrong PIN), it shows an error message. This 'if-else' logic is used everywhere, from traffic signals to smart home devices, ensuring they react correctly to different inputs.
Key Vocabulary
Key Terms
CONDITION: A situation or requirement that must be true or false for a decision to be made. | ALTERNATIVE: Another choice or option if the first one doesn't work out. | DECISION-MAKING: The process of choosing between different options. | LOGIC: A system of reasoning used to make correct conclusions.
What's Next
What to Learn Next
Next, you can learn about 'If-Else Statements' in programming. This will show you how to write these 'if' and 'else' rules as code, making computers follow your instructions to solve real-world problems. Keep up the great work!


