python实战练习:对哪部分使用类型转换
l = [] while True: s = input() if s == '0': #注意:这里是对0加引号,而不是使用int(s),如果输入'hello',int(s)会报错,所以是用字符串'0' break else: l.append(s) print(" ".join(l))
l = [] while True: s = input() if s == '0': #注意:这里是对0加引号,而不是使用int(s),如果输入'hello',int(s)会报错,所以是用字符串'0' break else: l.append(s) print(" ".join(l))