為什么python輸入內(nèi)容未覆蓋?
2020-03-18 15:14 作者:行動(dòng)大于野心 | 我要投稿
代碼:

prompt?=?input("Tell?me?something?,?and?I?will?repeat?it?back?to?you?:")
prompt?+=?"\n?Enter?'quit'?to?end?the?program:"
message?=""
while?message?!='quit':
????#msg=""
????message?=?input(prompt)
????if?message?!='quit':
????????print(message)

運(yùn)行效果;
Tell me something , and I will repeat it back to you :45
45
?Enter 'quit' to end the program:45
45
45
?Enter 'quit' to end the program:12
12
45
python 3.0 :message為啥還有第一次輸入的內(nèi)容,下期解答!
標(biāo)簽: