4.2_typechk_type.py 文件源码

python
阅读 30 收藏 0 点赞 0 评论 0

项目:Core-Python-Programming 作者: gdouchufu 项目源码 文件源码
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!!'
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号