我试图允许我的列表检查用户是否拒绝该请求,如果是,则激活我的if块,允许我邀请其他访客。每次我输入no,而不是激活if块它继续打印,我哪里出错了?或者我错过了哪些元素?
guestllist = ["me","batman","joker","wonder woman","peter rabbit"]
normal = guestllist
guestllist.reverse()
while len(normal):
# print("welome to the party " + guestllist.pop())
result = input("can you come " + guestllist.pop() + "?")
if result == "no":
print(result + " cannot make it")
input("our new guest shall be ")
guestllist = ["me","batman","joker","wonder woman","peter rabbit"]
guestllist.reverse()
while len(guestllist):
result = input("can you come " + guestllist.pop() + "?")
if result == "no":
print(result + " cannot make it")
input("our new guest shall be ")