一些处理变量的简单方法

①.title()       #将每个单词的首字母变为大写

②.lower()     #将全部字母变为小写

③.upper()    #将全部字母变为大写

④.strip()      #去除首尾空白

⑤.rstrip()     #去除尾部空白

⑥.lstrip()      #去除首部空白

猜你喜欢

转载自www.cnblogs.com/hank-python/p/9212613.html