I have just started to learn python and am trying to solve a basic elemenatary problem.
I would like to ask the user to input their name. There are only two valid names (Bob and Alice) that should receive a greeting. Any users who do not go by those names should receive an incorrect entry message.
I have created a list of names which include Bob and Alice. I have added a code to prompt the user to input their name.
I have written a print statement which greets the user after inputting the name.
The difficulty I am having is knowing which function I should use to invalidate any users that aren't Bob and Alice. I have written the following code;
names = ("Alice", "Bob", "Ray")
name = input("What is your name?")
if name == "Alice" "Bob":
print("Hello", name)
else:
print("Invalid entry")
My code is only ending in invalid entry, regardless of which name is used.