我很困惑为什么突出显示的if
语句不起作用。如果我输入“删除”或“删除”,则不会打印每条消息的消息。
while user != "":
if user.lower() != "remove" or user.lower() != "removeall":
recipients.append(user)
userQuery()
elif user.lower() == "remove":
if not recipients:
print("You haven't added any recipients yet.")
userQuery()
else:
del recipients[-1] # Removes the last item of the list
elif user.lower() == "removeall":
if recipients:
print("Removed every user from the recipient list.")
recipients = [] # Removes every item from the list
userQuery()
else:
print("Can't delete an empty recipients list.")
userQuery()