Operators & Decision Making

Operators and Decision Making in Python help us perform operations and make decisions in a program.

They are very important concepts in Python programming for beginners.

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

1. Arithmetic Operators

Used to perform calculations:

  • + → Addition
  • - → Subtraction
  • * → Multiplication
  • / → Division

2. Comparison Operators(Relational)

Used to compare values:

  • == → Equal
  • > → Greater than
  • < → Less than

3. Logical Operators

Used to combine conditions:

  • and → Both conditions must be True
  • or → At least one condition is True
  • not → Reverses the result

What is Decision Making?

Decision Making in Python means choosing an action based on a condition.

It is done using:

  • if
  • else
  • elif

It helps programs:

  • Decide what to do next
  • Work 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 >= 50Comparison operator checks condition
  • if → makes a decision based on condition
  • Output depends on True/False result 

Common Beginner Mistakes

  • Using = instead of ==
  • Missing colon (:) after if
  • Wrong indentation
  • Incorrect conditions


➤ Summary

  • Operators perform calculations and comparisons
  • Decision Making uses conditions
  • if, else, elif control program flow
  • Works based on True or False
  • Used in real-world programs

 

➤ Tips 

  • Practice simple if conditions
  • Use correct operators
  • Understand True/False logic
  • Try real-life examples

Check your knowledge

Quickly verify what you've learned from this tutorial.

Question 1

What are operators in Python?

Operators are symbols used to perform operations.

Question 2

What is the output?

print(10 > 5)

10 is greater than 5, so result is True.

Question 3

Which keyword is used for decision making?

if is used to make decisions in Python.

Question 4

What is the output?
marks = 40

if marks >= 50:
print("Pass")
else:
print("Fail")

40 is less than 50, so condition is False.

Question 5

Find Output?
x = 10
y = 20
print(x > y)

x > y checks if 10 is greater than 20, which is False, so the output is False.

Congratulations!

You've successfully mastered the knowledge check for "Operators & Decision Making."

For more questions and practice, click the link below:

Practice More Questions
Previous Topic User Input (input()) Next Topic Arithmetic Operators