python - Why is this code not working -
this question has answer here:
what trying user input name , have program take name , test "if" statements
name = input("enter name here: ") if name "bill": print("hello" + name) else: print("hello") whenever input bill name says program on without printing second command.
try if name == "bill": rather is.
it understanding is compares identity rather value equality.
Comments
Post a Comment