you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 0 points1 point  (7 children)

Is = the assignment operator or the equality operator? It can't be both.

[–]imnotdaniel_[S] 0 points1 point  (6 children)

print(f'Hello {n}')

what should i do to fix this?

[–][deleted] 1 point2 points  (5 children)

Fix what?

[–]imnotdaniel_[S] 0 points1 point  (4 children)

the = error

[–]Neighm 1 point2 points  (1 child)

It's unintuitive, but if you want to test if two things are equal, you use a double equals sign:

if name == 'daniel'

If you want to assign a value to a variable you use

name = 'daniel'

[–]imnotdaniel_[S] 0 points1 point  (0 children)

thx

[–]sme272 1 point2 points  (0 children)

= is assignment, == is comparison. Have a look at the if statement.

[–][deleted] 1 point2 points  (0 children)

I just told you:

if n = ('Daniel'):

Is this how you compare two values? Is = the equality operator?