HOLIDAY SALE! Save 50% on Membership with code HOLIDAY50. Save 15% on Mentorship with code HOLIDAY15.

9) Operators and Booleans Lesson

Introduction: Python Operators

3 min to complete · By Martin Breuss

You can encounter operators in your daily life. For example, while you might not explicitly see them, you know they are there when you look at your receipts after grocery shopping.

Ukrainian receipt with smiley faces

In this receipt, a computer added a few prices together to produce a final result. Even though the operator might not be displayed, you know that there's a symbol that can describe this operation: +.

Even if you might not understand anything about the language describing the mystery goods you purchased, you can still understand that the numbers have been added.

Python Operators

Python operators largely follow the intuition for mathematical operators you might have from school or everyday life.

Colorful illustration of a light bulb

Info: In their essence, operators are symbols with specific meanings that allow you to bring values in context with each other.

You've heard about values. Now, you will learn how to manipulate values and compare and contrast them using Python operators.

Types of Operators

In this section, you will learn about the following types of operators:

  • Assignment Operator: Makes a symbol refer to a value
  • Arithmetic Operators: Do arithmetic calculations
  • Membership Operator: Checks whether an element is part of a collection
  • Relational Operators: Compare two or more values to each other
  • Logical Operators: Compare values based on logic
  • Identity Operator: Finds out whether two values point to the same object in

You have already encountered the assignment operator and others, but you'll explore them more deeply in this section. You'll start by revisiting the assignment operator in the next lesson.

Colorful illustration of a light bulb

Additional Resources Cheatsheet: Python Operators

Summary: Introduction to Python Operator

  • Operators are what allow you to manipulate values.
  • The addition symbol is an example of an operator.