그래서 기본적으로 당신이 질문을 구성하는이 코드를 가지고 있지만 입력 된 질문에 대한 답변을하므로 질문 하나만을 물을 수 있습니다. 그러면 전체를 다시 설정해야합니다. 다시는 또 다시, 나는 당신에게 당신의 이름을 먼저 물으려고합니다. 그래서 그것을 무시하는 루프를 원합니다.어떻게 파이썬에서 입력을 재설정합니까
print("hello,what is your name?")
name = input()
print("hello",name)
while True:
question = input("ask me anything:")
if question == ("what is love"):
print("love is a emotion that makes me uneasy, i'm a inteligence not a human",name)
break
if question == ("i want a dog"):
print("ask your mother, she knows what to do",name)
break
if question == ("what is my name"):
print("your name is",name)
break
당신은'break' 문 치우는 시도 했습니까? 아마도 exit 조건을 추가하고 싶을 것입니다 (예 :'question == ("Quit") 인 경우) : break' – nbryans
[How to ask] (http://stackoverflow.com/help/how-to-ask)를 참조하십시오. –