如果我想取一个数字作为输入,我还需要这个.strip()方法吗?像这样:
.strip()
n = int(input().strip())
而不仅仅是编码:
n = int(input())
我知道.strip()返回一个字符串的副本,其中所有字符都已从字符串的开头和结尾剥离.但我想知道为什么/如果有必要.
python string int
int ×1
python ×1
string ×1