Linux/Unix > Python Essential Reference, Second Edition > 2. Lexical Conventions and Syntax > Operators, Delimiters, and Special Symbols | See All Titles

< BACK | Make Note | Bookmark | CONTINUE >

155117184014003188065099048180054212144238241179195140058238110137104027027049180116078243

### Operators, Delimiters, and Special Symbols

The following operator tokens 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, while 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 `?` cannot appear in a program except inside a quoted string literal.

| Last updated on 3/28/2002 Python Essential Reference, Second Edition, © 2002 New Riders Publishing

< BACK | Make Note | Bookmark | CONTINUE >

© 2002, O'Reilly & Associates, Inc.