如何在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
提交
取消