lundi 19 décembre 2016

Python Function That Returns "Hello" + Input + "!" Except For Two Specific Cases

I'm trying to create a Python function that returns a polite greeting for everyone except for Lewis and Clark. Here is what I tried:

def politeGreeting(name):
#if the user's name is Lewis or Clark, say "Oh, it's you." 
if name == "Lewis" or "Clark":
    return("Oh, it's you")
#if the user's name is anything else
else:
    return("Hello," + name + "!")

name = input("please enter your name")        
print (politeGreeting(name))

Right now, this is printing Oh, it's you for everyone, not just for Lewis and Clark. I don't understand why - my IDE isn't returning any error messages. Please help if you can, thank you.

Aucun commentaire:

Enregistrer un commentaire