python中用input输入时可以回车换行

#实现回车换行,而不是结束
endstr="end"#重新定义结束符
str=""
for line in iter(input,endstr):#每行接收的东西
str+= line+"\n"#换行
print(str)

猜你喜欢

转载自www.cnblogs.com/zlong123/p/10427519.html
今日推荐