I am printing type(int). Please explain me about this behaviour. thanks in advance.
print(type(int))
I am printing type(int). Please explain me about this behaviour. thanks in advance.
print(type(int))
int
IS a type name (class name), while 1
is an object of type int
And "int"
would be a string.
Check:
type(1) is int
type(int) is type
type("int") is str
type(str) is type
type(type) is type
Some build-in types are int
, str
, float
, list
, set
, dict
... And yes, all those names by themselves are of type type
int
itself is a type
type(0)
#int
type(int)
#type
Your example is no different to
print(type(type(0)))