私はPythonに少し慣れていません.raw_inputにフォーマットされた文字列を入力しようとしていますが、出力は「\ n」文字を変更せず、常にnullを返します. 空の変数を介して完全にフォーマットされた文字列/テキストをポンピングする方法はありますか?
text = ""
stop = "|"
while True:
text_1 = raw_input()
text += "%s" % (text1)
if text_1 != stop:
pass
else:
break
print text
output:
hello world
how are you
|
hello worldhow are you|
必要: こんにちは世界お元気ですか |