字符串的首尾字符去除 and 输出格式

a='*q*w*e*'
print(a.strip('*'))去除首尾 *
print(a.lstrip('*'))去除左边 *
print(a.rstrip('*'))去除右边 *

 

posted @ 2021-03-04 11:27  火烧火燎  阅读(46)  评论(0)    收藏  举报