这是代码
Members = ["MrRager", "Giancarlo", "TheFoolishOne"] # participants of Last Man Standing Challenge
MrRager = raw_input("Did Mr Rager make it through today?")
if MrRager == raw_input("No"):
Members.remove("MrRager")
print Members
# every time a member fails, doesn't check in for a while, or leaves we will remove from list above.
所以,基本上我希望脚本能够询问会员今天完成的问题。如果raw_input为yes,它将保持不变。然后,我想如果我键入一个否,它将从列表中删除该人。当我输入no时,它再次打印,然后保持列表相同。
答案 0 :(得分:0)
raw_input
获取用户的输入并将其返回,以便将其存储在MrRager
变量中。您不需要再次获取用户的输入,只需测试该变量的内容:
if MrRager == "No":
Members.remove("MrRager")