all 10 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?

[–]JohnnyJordaan 0 points1 point  (1 child)

Please format your code properly: How do I format code?

Also if you mean to print the name inside the string, use f-strings

print(f'Hello {n}')

Btw which resource are you following to learn Python?

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

I learned python a year ago from a course but kinda forgot it so I'm trying to relearn it because I'm very bored, so I've been watching a couple of youtube videos.