def proc(a)
def proc(a)
>>> a = 1
>>> type(a)
type 'int'
>>> a = "A!"
>>> type(a)
type 'str'
try:
type(b)
except:
print "hadling exception..."
def proc(a):
if type(a) == str:
print 'str'
elif type(a) == int:
print 'int'
elif a == None:
print 'NoneType'
try:
a
except NameError:
print 'a - not define'
if isinstance( a, int ): #int elif isinstance( a, basestring ): #str or unicode elif a is None: #None
elif isinstance( a, basestring ):
elif isinstance( a, str):
def proc(a): print(type(a))
<class 'str'> <class 'int'> <class 'float'> # итд