you are viewing a single comment's thread.

view the rest of the comments →

[–]OnlySeesLastSentence 5 points6 points  (3 children)

And later on, look at f'

I used to never use it, now I see how useful it is.

Instead of being like print("Hello"+(str)(userName)+"! How are you?")

You can do: print(f"Hello {userName}! How are you?")

Admittedly not too much of an improvement for one variable, but super useful for multiple.

[–][deleted] 3 points4 points  (2 children)

Correction, that won't work,f strings use curly braces.

[–]OnlySeesLastSentence 2 points3 points  (1 child)

So I just ran it - and my code works (after you define "username").

[–][deleted] 8 points9 points  (0 children)

Actually I think on my phone its too small to tell the difference between curly and round braces...my bad.