🐍 Python Hands-on Hub

Create Small Applications using Conditionals

Grade VII Computer Science

Learning Objectives

Recap: Conditional Statements

Conditional statements help a program make decisions. Python checks whether a condition is True or False before executing instructions.

if condition:
    statement

elif condition:
    statement

else:
    statement

Mini Application 1

Even or Odd Number Checker

num = int(input("Enter a number: "))

if num % 2 == 0:
    print("Even Number")
else:
    print("Odd Number")

Mini Application 2

Voting Eligibility Checker

age = int(input("Enter your age: "))

if age >= 18:
    print("Eligible to Vote")
else:
    print("Not Eligible")

Mini Application 3

Positive, Negative or Zero

num = int(input("Enter a number: "))

if num > 0:
    print("Positive")

elif num < 0:
    print("Negative")

else:
    print("Zero")

Mini Application 4

Simple Password Checker

password = input("Enter Password: ")

if password == "python123":
    print("Access Granted")

else:
    print("Wrong Password")

Mini Application 5

Grade Calculator

marks = int(input("Enter Marks: "))

if marks >= 90:
    print("Grade A")

elif marks >= 75:
    print("Grade B")

elif marks >= 60:
    print("Grade C")

else:
    print("Needs Improvement")

Comparison Operators Used

Operator Meaning
== Equal To
!= Not Equal To
> Greater Than
< Less Than
>= Greater Than or Equal To
<= Less Than or Equal To

Class Activity

Create any ONE application from the list below.

Challenge Activity

Design your own Python application using at least:

Quick Quiz

  1. What is a conditional statement?
  2. Which keyword checks another condition?
  3. Which keyword executes when all conditions are False?
  4. Write the syntax of an if statement.
  5. Name two comparison operators.

Learning Outcomes

⬅ Back to Grade VII