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