Python 中的 string.whitespace
在本教程中,我們將瞭解string.whitespace。
字串whitespace在Python 3 的string 模組中進行了預定義。它包含空格、製表符、換行符、回車符、換頁符和垂直製表符。
示例
# importing the string module
import string
# printing a string
print("Hello")
# whitespace printing
print(string.whitespace)
# printing a string
print('tutorialspoint')輸出
如果你執行以上程式碼,就會得到以下結果。
Hello tutorialspoint
結論
如果本教程存在任何疑問,請在評論部分中提出。
廣告
資料結構
網路
RDBMS
作業系統
Java
iOS
HTML
CSS
Android
Python
C 程式設計
C++
C#
MongoDB
MySQL
Javascript
PHP