string.octdigits 在 Python 中
本教程中,我們將學習有關 string.octdigits 字串。
在 Python3 的 string 模組中預定義了字串 octdigits。我們可以直接透過訪問 string 模組在程式中隨時使用八進位制數字。
示例
# importing the string module import string # printing the octal digits string print(string.octdigits)
輸出
如果你執行以上程式碼,則會得到以下結果。
01234567
string.octdigits 是一個字串。你可以透過執行以下程式來呼叫它。
示例
# importing the string module import string # printing the octal digits string print(type(string.octdigits))
輸出
如果你執行以上程式碼,則會得到以下結果。
<class 'str'>
總結
如果你對教程有任何疑問,請在評論部分中提及。
廣告
資料結構
網路
關係型資料庫管理系統
作業系統
Java
iOS
HTML
CSS
Android
Python
C 程式設計
C++
C#
MongoDB
MySQL
Javascript
PHP