1. Home
  2. Computing & Technology
  3. Python

Beginning Python: Operators

From , former About.com Guide

2 of 3

Common Operators

Python uses the following operators:

+ addition (unary plus)
- subtraction (unary minus)
* multiplication
**
/ division
% modulo
< less than
> greater than
<= less than or equal to
>= greater than or equal to
== equal to
!= not equal to
<> an obsolete form of 'not equal to'

For strings, however, Python has just one operator: + for concatenation. All other operations are performed using modules like string or re.

Explore Python
About.com Special Features

The Best Web Trends of the Decade

A look back at the best innovations, ideas and technologies over the last 10 years, More >

Family Tech Center

Stay connected and entertained with reviews on tips on the latest HDTVs, cellphones and more. More >

  1. Home
  2. Computing & Technology
  3. Python

©2009 About.com, a part of The New York Times Company.

All rights reserved.