0

I am just getting started learning, and I've been trying for awhile to get this done but I don't know what I am doing wrong

name = input("Enter name :")
if name is "Uber":
    print("Hello there, General "+ name ,",you are a bold one!")
else:
    print("Begone, " + name , ", you do not belong here.")

I want it to say "Hello there, General Uber, you are a bold one!" if the input is Uber, otherwise it must say "Begone (name),you do not belong here."

Itamar Mushkin
  • 2,803
  • 2
  • 16
  • 32
UberLaoch
  • 13
  • 2

1 Answers1

1

is is used for comparing the identity of objects, and the input and "Uber" are not the same object.

To test for equality, use ==:

if name == "Uber":
molbdnilo
  • 64,751
  • 3
  • 43
  • 82