Day 5 — if–else (Complete Decisions)

Python Starter Club • Programmer’s Picnic • Champak Roy

Today we teach Python what to do when a condition is False.

Comic

🎨 Day 5 Comic — if–else

Day 5 if-else comic
Lesson

🧠 Understanding if–else

if condition:
    print("YES")
else:
    print("NO")
age = int(input("Enter age: "))
if age >= 18:
    print("Eligible")
else:
    print("Not eligible")
📝 Day 5 Task
Ask the user for a number.
If the number is even print "Even", else print "Odd".
Interactive Preview

🎛️ Even / Odd (Preview)

Flowchart

🔀 Odd / Even Decision Flow

This is how Python thinks internally. The highlighted path shows what happens for your input.

Start n % 2 == 0 ? True False Print "Even" Print "Odd"
Only one path is taken. The other is ignored.
Pyodide

🐍 Run Python Code

Output will appear here…

🧾 Day 5 Worksheet

Name: ____________ Date: ____________

Q1. What does if do?

Q2. What does else do?

Q3. True/False: 5 % 2 == 0

Q4. Write a program to check even or odd.

Decision Tree

🌳 From if–else to Decision Tree

Write a simple if–else. We will convert it into a decision tree.

Code is just a written form of decisions.