当我使用这个输入验证循环时,即使答案是正确的,它也会循环

时间:2017-06-18 17:07:41

标签: python python-3.x

def HouseVer():
    my_house=""
    while my_house !="green" and my_house !="red" and my_house !="purple" and  my_house !="yellow":
        my_house=input("Wich house do you live in?, green, red, purple, or yellow ")

    return my_house
HouseVer()

0 个答案:

没有答案