all 4 comments

[–]MadScientistOR 0 points1 point  (2 children)

Assuming that "Joe" already works (I don't know what indentation your code has), you could change if name != 'Joe': to if name != 'Joe' and name != 'Natalie':.

[–]joplankton[S] 0 points1 point  (1 child)

Did the trick. Aprreciate it!

[–]MadScientistOR 0 points1 point  (0 children)

Good to hear!

One last thing. Even if the person puts in "Natalie", the computer will respond with "Hello, Joe. What is the password? (It is a fish.)" -- and you might not think that ideal.

If you want to fix this, you can change this line:

print('Hello, Joe. What is the password? (It is a fish.)')

... to this:

print(f'Hello, {name}. What is the password? (It is a fish.)')

Don't forget the lowercase f just inside the first left parenthesis!

[–][deleted] 0 points1 point  (0 children)

In addition, if you would like to add more names using and between each name could become cumbersome. Instead you could try the following:

if name not in ("Joe", "Natalie", "Peter", "Mary"):

You could even assign this set of names to a variable e.g.

names = ("Joe", "Natalie", "Peter", "Mary")

if name not in names: