响应用户的输入

时间:2015-09-07 20:08:41

标签: python input wait

我的代码看起来有点像这样:

question=input("What is your question?")

print("Let me think about that...")
import time
time.sleep(10) # delays for 10 seconds

print("I don't want to answer that question right now.")
print(question)

print("Ha ha ha")

我的问题在最后一行,因为我不知道如何让程序在程序笑之前等待用户输入他们的响应。我认为它与输入功能有关,但我不知道......

1 个答案:

答案 0 :(得分:0)

如果我理解正确...以下代码不应该解决您的问题吗?

question = input("What is your question? ")

print("Let me think about that...")
import time
time.sleep(10) # delays for 10 seconds

print("I don't want to answer that question right now.")
answer = input(question)

print("Ha ha ha")