0
why does this line of code not working
name = input("what is your name") if name = (Colby) print("hello brother")
3 Answers
+ 3
comparison operator for equality is ==, or === if you also need to compare types. = is an assignment operator for assigning data on the right to the variable on the left. your code should be the following:
name = input("what is your name?")
if name == "Colby":
print("hello brother")
0
you should write:
" if name = ("Colby"): "
0
= is the assignment operator.
you gotta use 'is' for comparison
as in:
if name is ('Colby'):
print(' whaad up col dawg?!')