Python Conditionals, Lists, Dictionaries, and Operators - Operators (
Page 6 of 6 )
The following is a list of operators you can use in Python:
|
Symbol |
Type |
What it Does |
|
+ |
Mathematical |
Addition |
|
- |
Mathematical |
Subtraction |
|
* |
Mathematical |
Multiplication |
|
/ |
Mathematical |
Division |
|
// |
Mathematical |
Truncating Division |
|
** |
Mathematical |
Powers |
|
% |
Modulos |
Returns the remainder from a division |
|
<< |
Shift |
Left Shift |
|
>> |
Shift |
Right Shift |
|
& |
Logical |
And |
|
| |
Logical |
Or |
|
^ |
Logical |
Bitwise XOR |
|
~ |
Logical |
Bitwise Negation |
|
< |
Comparison |
Less than |
|
> |
Comparison |
Greater than |
|
'==' |
Comparison |
Equal to |
|
!= |
Comparison |
Not Equal To |
|
>= |
Comparison |
Greater than or Equal To |
|
<= |
Comparison |
Less than or Equal To |
|
'=' |
Assignment |
Assigns a value |
|
+= |
Assignment |
Adds and assigns a value |
|
-= |
Assignment |
Subtracts and Assigns a value |
|
*= |
Assignment |
Multiplies and assigns a value |
|
/= |
Assignment |
Divides and assigns a value |
|
//= |
Assignment |
Truncate Divides and assigns a value |
|
**= |
Assignment |
Powers and assigns |
|
%= |
Assignment |
Modulus and assigns |
|
>> |
Assignment |
Shifts and assigns |
|
<< |
Assignment |
Shifts and assigns |
|
And |
Boolean |
|
|
Or |
Boolean |
|
|
Not |
Boolean |
|
Unfortunately I don't have time to discuss these operators in this tutorial, but join me for the next episode where I will be discussing Sets and how to manipulate data with the rest of these operators. Thanks again for stopping by and remember to check in often for new series from yours truly and others.
Till then...
|
|
|
|
| |
|
|
|
|
 |
|
|
|