Lesson 3: If... Else Logic

Decisions are the heart of programming. Just like in life ("If it rains, I take an umbrella, else I wear a t-shirt"), programs also need to make choices.

In Python we use keywords if, else, and elif (else if).

Indentation: The Golden Rule

Python is the only language where spaces matter! Code inside the IF must be moved to the right (indented).

if age >= 18:
    print("You are an adult")
else:
    print("You are a minor")

Your Objective

We created a secret password variable. Write a program that checks if the password is "Python123".

  1. Modify the input_password variable in the editor.
  2. If it equals "Python123", print "Access Granted".
  3. Else, print "Access Denied".
main.py
Initializing Python Environment...