>>> l = []
>>>
>>> l.__class__.__name__
'list'
===================
>>> t = ()
>>>
>>> t.__class__.__name__
'tuple'
===================
>>> d = {}
>>>
>>> d.__class__.__name__
'dict'
===================
>>> i = int(4)
>>>
>>> i
4
>>> i.__class__.__name__
'int'
===================
>>> f = float(4)
>>>
>>> f
4.0
>>>
>>> f.__class__.__name__
'float'
-------------------------
>>> class Test:
... pass
...
>>>
>>>
>>> t = Test()
>>>
>>> t.__class__.__name__
'Test'
===================
No comments:
Post a Comment