Monday, April 9, 2018

python - Why is my "if" statement not working?

I'm confused as to why the if statements highlighted aren't working. If I type "remove" or "removeall", the message I have for each message does not print.



https://pastebin.com/iawK1gyT



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()

No comments:

Post a Comment

plot explanation - Why did Peaches' mom hang on the tree? - Movies & TV

In the middle of the movie Ice Age: Continental Drift Peaches' mom asked Peaches to go to sleep. Then, she hung on the tree. This parti...