def displayNumType(num):
print num, "is",
if type(num) is types.IntType: # or : == types.IntType:
print 'an integer'
elif type(num) is long:
print 'a long'
elif type(num) is float:
print 'a float'
elif type(num) is types.ComplexType:
print 'a complex number'
else:
print 'not a number at all!!'
4.2_typechk_type.py 文件源码
python
阅读 30
收藏 0
点赞 0
评论 0
评论列表
文章目录