Python Tutorials · Python Operators

Python Operators

Learn all about Python Operators in this comprehensive tutorial.

5 min read beginner
  • Operators are used to perform operations on variables and values.

Python Operators

Operators are used to perform operations on variables and values.

In the example below, we use the + operator to add together two values:

python

Although the + operator is often used to add together two values, like in the example above, it can also be used to add together a variable and a value, or two variables:

python

Python divides the operators in the following groups:

  • Arithmetic operators
  • Assignment operators
  • Comparison operators
  • Logical operators
  • Identity operators
  • Membership operators
  • Bitwise operators

Module quiz

2 questions
1

Which of the following is true about Python Operators?

2

What is the most common pitfall when working with Python Operators?

Answer all questions to submit.