lstrip:剔除开头空白
strip:剔除两段空白
rstrip:剔除末尾空白
favorite: 最喜欢的
>>>favorite_language = "Python" >>>favorite_language.lstrip() "python " >>>favorite_language.strip() "python" >>>favorite_language.rstrip() " python"
原文:https://www.cnblogs.com/zhouxiin/p/10640790.html