Operators & Decision Making
Operators and Decision Making in Python help us perform operations and make decisions in a program.
They are important concepts in Python programming for beginners (Grade 1–10 students).
What are Operators?
Operators in Python are symbols used to perform operations on values.
They help in:
- Calculations (Arithmetic Operators)
- Comparisons (Comparison Operators)
- Logic building (Logical Operators)
Types of Operators
- Arithmetic Operators → Perform calculations (+, -, *, /)
- Comparison Operators → Compare values (==, >, <)
- Logical Operators → Combine conditions (and, or, not)
What is Decision Making?
Decision Making in Python means choosing an action based on a condition.
It is done using if, else, and elif statements.
- Helps programs decide what to do next
- Works based on True or False conditions
Example Program (Operators + Decision Making)
marks = 75
if marks >= 50:
print("Pass")
else:
print("Fail")
Output:
Pass
Explanation
marks >= 50→ Comparison operator checks conditionif→ makes a decision based on condition- Output depends on True/False result