O'Reilly logo

Python: Essential Reference, Third Edition by David Beazley

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Operators, Delimiters, and Special Symbols

The following operators are recognized:

+    -    *    **    /    //    %    <<    >>   &    |
^    ~    <     >    <=   >=    ==   !=    <>   +=
-=   *=   /=   //=   %=   **=   &=   |=    ^=   >>=  <<=

The following tokens serve as delimiters for expressions, lists, dictionaries, and various parts of a statement:

(    )    [    ]    {    }   ,    :    .    `    =    ;

For example, the equal (=) character serves as a delimiter between the name and value of an assignment, whereas the comma (,) character is used to delimit arguments to a function, elements in lists and tuples, and so on. The period (.) is also used in floating-point numbers and in the ellipsis (...) used in extended slicing operations.

Finally, the following special symbols are also used:

'     "     #     \    @

The characters $ and ? have no meaning ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required