Advertisement

python数字类型介绍及其创建和删除数字引用操作实例

阅读量:
复制代码
 #coding=utf8

    
 '''
    
 数字类型:
    
 数字提供标量贮存和直接访问。
    
 它是不可更改类型,变更数字的值会产生新的对象。
    
 Python支持多种数字类型:整型、长整型、布尔型、双精度浮点型、十进制浮点型和复数。
    
 '''
    
 def digtalIndroduce():
    
     ''' 创建数值对象并给其赋值 '''
    
     print "The first give the variable to value"
    
     Int=45
    
     Long=4444444444444L
    
     Bool=True
    
     Float=3.141592653589793228885555558888
    
     Dicmal=10.25
    
     Complex=25+12.36j 
    
     
    
     print "%d the id:%r"   %(Int,id(Int))
    
     print "%r the id:%r"   %(Long,id(Long))
    
     print "%r the id:%r"   %(Bool,id(Bool))
    

全部评论 (0)

还没有任何评论哟~