Operator Precedence Table
func_names(args, ...) |
Function call |
x[index:index] |
Slicing |
x[index] |
Indexing |
x.attribute |
Attribute reference |
** |
Exponentiation |
*, /, % |
Multiply, divide, mod |
+, - |
Add, subtract |
>, <, <=, >=, !=, == |
Comparison |
in, not in |
Membership tests |
not, and, or |
Boolean operators |
Module Import
import module_name |
from module_name import name, ... |
from module_name import * |
|
|
Data Types
TYPE |
DESCRIPTION |
EXAMPLE |
int |
32-bit Integer (unlimited in 3.x) |
3, -4 |
long |
unlimited Integer (dropped in 3.x) |
101L |
float |
Floating point number |
3.0, -6.55 |
complex |
Complex number |
bool |
Boolean |
True, False |
str |
Character sequence |
"Immutable object" |
str |
Character sequence |
"Immutable object" |
tuple |
Immutable sequence |
(2, "a", [1, 2], (5, 6)) |
list |
Mutable Sequence |
[1, [a, b], ("a", "b")] |
dict |
Mapping |
{x:2, y:5} |
|
|
|