Проверка на тип в Python

Posted by & filed under python.

d={} if type(d)==type(dict()): print ‘Its dict!’ else: print ‘Its not dict’ 2 способ (более лучший ИМХО): d={} if type(d) is dict: print ‘Its dict!’ else: print ‘Its not dict’