内射老阿姨1区2区3区4区_久久精品人人做人人爽电影蜜月_久久国产精品亚洲77777_99精品又大又爽又粗少妇毛片

Python中oct()函數(shù)的語法-創(chuàng)新互聯(lián)

這篇文章主要介紹Python中oct()函數(shù)的語法,文中介紹的非常詳細,具有一定的參考價值,感興趣的小伙伴們一定要看完!

成都創(chuàng)新互聯(lián)公司主要從事成都網(wǎng)站設計、成都網(wǎng)站建設、網(wǎng)頁設計、企業(yè)做網(wǎng)站、公司建網(wǎng)站等業(yè)務。立足成都服務揚州,10多年網(wǎng)站建設經(jīng)驗,價格優(yōu)惠、服務專業(yè),歡迎來電咨詢建站服務:18982081108

什么是oct函數(shù)?

oct()函數(shù)是Python3中的內(nèi)置方法之一。 oct()方法采用整數(shù),并以字符串格式返回其八進制表示形式。

oct()語法如下:

Syntax : oct(x) #語法
 
Parameters :   #參數(shù)
 
x – Must be an integer number and can be in either binary, decimal or hexadecimal format.
#  x必須為整數(shù),并且可以為二進制,十進制或十六進制格式。
 
Returns : octal representation of the value.#返回值的八進制表示形式。
 
Errors and Exceptions :   #錯誤和異常:
TypeError : Returns TypeError when anything other than integer type constants are passed as parameters.
#TypeError:當將整數(shù)類型常量以外的任何內(nèi)容作為參數(shù)傳遞時,返回TypeError。

oct()函數(shù)的用法

print("The octal representation of 23 is " + oct(23))
print("The octal representation of the"
" ascii value of 'z' is " + oct(ord('z')))
print("The octal representation of the binary"
" of 23 is " + oct(0b10111))
print("The octal representation of the binary"
" of 23 is " + oct(0x17))

輸出:

The octal representation of 23 is 0o27
The octal representation of the ascii value of 'z' is 0o172
The octal representation of the binary of 23 is 0o27
The octal representation of the binary of 23 is 0o27

以上是Python中oct()函數(shù)的語法的所有內(nèi)容,感謝各位的閱讀!希望分享的內(nèi)容對大家有幫助,更多相關(guān)知識,歡迎關(guān)注創(chuàng)新互聯(lián)行業(yè)資訊頻道!

網(wǎng)站欄目:Python中oct()函數(shù)的語法-創(chuàng)新互聯(lián)
網(wǎng)站路徑:http://www.rwnh.cn/article6/pcdig.html

成都網(wǎng)站建設公司_創(chuàng)新互聯(lián),為您提供商城網(wǎng)站網(wǎng)站排名、搜索引擎優(yōu)化網(wǎng)站維護、移動網(wǎng)站建設、標簽優(yōu)化

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時需注明來源: 創(chuàng)新互聯(lián)

營銷型網(wǎng)站建設
昆明市| 潞西市| 田林县| 八宿县| 合江县| 积石山| 阿克| 高尔夫| 井冈山市| 宁明县| 遂宁市| 东兰县| 甘泉县| 神木县| 营口市| 白银市| 全州县| 鸡泽县| 竹溪县| 雅江县| 旬阳县| 苗栗县| 萍乡市| 甘南县| 东光县| 盖州市| 进贤县| 南澳县| 登封市| 嘉善县| 湘阴县| 镇坪县| 双柏县| 当雄县| 旺苍县| 林口县| 岫岩| 罗甸县| 新安县| 将乐县| 新化县|