type() returns the type for any Python object, not just the standard types. : Type : Buildin Function PYTHON TUTORIALS


PYTHON TUTORIALS » Buildin Function » Type »

 

type() returns the type for any Python object, not just the standard types.


print type('')
s = 'xyz'
print type(s)
print type(100)
print type(0+0j)
print type(0L)
print type(0.0)
print type([])
print type(())
print type({})
print type(type)
class Foo: pass            # new-style class
foo = Foo()
class Bar(object): pass    # new-style class
bar = Bar()
print type(Foo)
print type(foo)
print type(Bar)
print type(bar)



Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .


PYTHON TUTORIALS

 Navioo Buildin Function
» Type