0
def greeting(string):
    greet=["Good Morning"+' '+string]
    return(greet)

print("Enter your name")
name=input()

if(name is "Saptarshi"):
    greet=greeting(name)
    print(greet)

elif(name is "Gurpreet"):
    greet=greeting(name)
    print(greet)

else:
    print("No greeting for you!")
Progman
  • 16,827
  • 6
  • 33
  • 48
saptarshi
  • 9
  • 3

1 Answers1

1

Use == instead of is.

Python is operator compares two variables and returns True if they reference the same object. If the two variables reference different objects, the is operator returns False.

a = 100
b = a
result = a is b # True

d = 10
e = 10
result = d is e # False
Kiran Parajuli
  • 820
  • 6
  • 14