如何在Python中读取多行原始输入?我想要创建一个Python程序,它接受多行用户输入。例如:This is a multilined input.
It has multiple sentences.
Each sentence is on a newline.如何接受多行原始输入?
3 回答
哆啦的时光机
TA贡献1779条经验 获得超6个赞
stopword
text = ""stopword = ""while True: line = raw_input() if line.strip() == stopword: break text += "%s\n" % lineprint text
添加回答
举报
0/150
提交
取消