欢迎光临散文网 会员登陆 & 注册

为什么python输入内容未覆盖?

2020-03-18 15:14 作者:行动大于野心  | 我要投稿

代码:

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)

运行效果;

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为啥还有第一次输入的内容,下期解答!

为什么python输入内容未覆盖?的评论 (共 条)

分享到微博请遵守国家法律