国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 編程 > Python > 正文

Python整型:布爾型、標準整型、長整型操作實例

2019-11-08 01:28:36
字體:
供稿:網(wǎng)友
#coding=utf8 def integerType():    '''    布爾型:    該值的取值范圍只有兩個值:True(1)、False(0)    '''    Tbool=True    Fbool=False    PRint "The True is stand for %d" %(Tbool)    print "The False is stand for %d" %(Fbool)    print    '''    python標準整數(shù)類型:    Python標準整數(shù)類型是最通用的數(shù)字類型。    在大多數(shù)32位機器上,標準整數(shù)類型的取值范圍:-2147483648 到 2147483647    Python標準整數(shù)類型等價于C的有符號長整型。    八進制整數(shù)以數(shù)字“0”開始。    十六進制整數(shù)以“0x”或“0X”開始        '''    bInt=010101    dInt=84455555    oInt=075    hInt=0xabc    print "The binary of  the standard integer:",bInt    print "The decimal of  the standard integer:",dInt    print "The octal of  the standard integer:",oInt    print  "The hexadecimal of  the standard integer:",hInt    print    '''    python長整型:    Python長整型能表達的數(shù)值僅僅與機器值的(虛擬)內(nèi)存大小有關(guān)。    長整數(shù)類型是標準整數(shù)類型的超集。    在一個整數(shù)值后面加上個L(大寫或小寫都可以,推薦使用大寫,避免和數(shù)字1混淆),表示這個整數(shù)時長整數(shù)。    這個整數(shù)可以是十進制、八進制、十六進制。    只有對長整數(shù)調(diào)用repr()才有機會看到L,對長整數(shù)調(diào)用str()看不到L。       整型和長整型正在統(tǒng)一為一種。    '''    bLong=0111111111111111111111111111111111111111111111L    dLong=8888888888888888888888888888888888888888888888L    oLong=0777777777777777777777777777777777777777777777L    hLong=0XFFFFFFFFFFFFFFFFFAAAAAAAAAAAAABBBBBBBBBB78L        print "The binary of  the long integer:",repr(bLong)    print "The decimal of  the long integer:",repr(dLong)    print "The octal of  the long integer:",repr(oLong)    print  "The hexadecimal of  the long integer:",repr(hLong)    print       '''call  the function : integerType()'''integerType()
發(fā)表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發(fā)表
主站蜘蛛池模板: 遂平县| 定边县| 怀宁县| 岳普湖县| 图木舒克市| 杭州市| 瓦房店市| 德昌县| 霞浦县| 东辽县| 芦溪县| 安新县| 清丰县| 乌鲁木齐市| 巴彦县| 灌云县| 延津县| 澄迈县| 彭水| 古交市| 琼结县| 娱乐| 哈巴河县| 顺义区| 丘北县| 易门县| 虎林市| 抚州市| 惠东县| 新密市| 黔江区| 辽阳县| 开平市| 乐业县| 屯昌县| 安顺市| 萝北县| 彰化县| 仁寿县| 贞丰县| 比如县|