Beginning Programming with Python For Dummies
Book image
Explore Book Buy On Amazon
Operator Description
() Parentheses are used to group expressions and to override the default precedence so that you can force an operation of lower precedence (such as addition) to take precedence over an operation of higher precedence (such as multiplication).
** Exponentiation raises the value of the left operand to the power of the right operand.
~ + - Unary operators interact with a single variable or expression.
* / % // Multiply, divide, modulo and floor division.
+ - Addition and subtraction.
>> << Right and left bitwise shift.
& Bitwise AND.
^ | Bitwise exclusive OR and standard OR.
<= < > >= Comparison operators.
== != Equality operators.
= %= /= //= -= += *= **= Assignment operators.
is is not Identity operators.
in not in Membership operators.
not or and Logical operators.

About This Article

This article is from the book:

About the book author:

John Paul Mueller is a freelance author and technical editor with more than 107 books and 600 articles to his credit. His subjects range from networking and artificial intelligence to database management and heads-down programming. He also consults and writes certification exams. Visit his website at

This article can be found in the category: