strip()函數的目的是去除字符串中的首位符號
中間位置的符號不管用
In [68]: " Strip fuction ".strip()
Out[68]: 'Strip fuction'
In [72]: "\tStrip fuction\n".strip()
Out[72]: 'Strip fuction'
In [73]: "\tStrip \n fuction\n".strip()
Out[73]: 'Strip \n fuction'
strip()函數的目的是去除字符串中的首位符號
中間位置的符號不管用
In [68]: " Strip fuction ".strip()
Out[68]: 'Strip fuction'
In [72]: "\tStrip fuction\n".strip()
Out[72]: 'Strip fuction'
In [73]: "\tStrip \n fuction\n".strip()
Out[73]: 'Strip \n fuction'
1.while循環的格式 while 條件: 條件滿足時,做的事情1 條件滿足時,做的事情2 條件滿足時,做的事情3 ...(省略)... demo