Python Operators


Python Operators

Operators are used to perform operations on variables and values.

Python divides the operators in the following groups:

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

Example

Arithmetic operators are used with numeric values to perform common mathematical operations:

print(5 + 3)
print(5 - 3)
print(5 * 3)
print(12 / 3)
print(5 % 2)
print(5 ** 2)
print(15 // 2) 
Try it Yourself »


Copyright 1999-2023 by Refsnes Data. All Rights Reserved.