type
: >>> num = 42 >>> pie = 3.14156 >>> type(num) <class 'int'> >>> type(pie) <class 'float'>
builtin_function_or_method | |
bytes | |
code | |
coroutine | |
dict | |
ellipsis | |
frozenset | |
int | stores an arbitrarily large (in Python 3, that is) integral numerical value. |
float | |
iterator | |
list | |
list_iterator | |
method | |
NoneType | |
set | |
slice | returns slice object |
str | A representation of a string |
traceback | |
tuple | |
type | represents a type itself. |
def
statement)
method
type
async def
)
list
and a dict
are represented with the spcial symbols: the list
with square brackets, the dict
with curly braces: >>> dict() {} >>> list() []
b
: >>> bytes() b''
collections.abc.Sequence
abstract base class is a sequence that also provides the following methods: count()
index()
__contains__()
__reversed__()
register()
. load_module()
method that a loader is required to implement. NoneType
has one value: None
which is typically used to represent the absence of any value (much like null
in SQL). >>> type(None) <class 'NoneType'> >>> None = 42 SyntaxError: cannot assign to None
import
. __path__
attribute is a package.