Hacker News new | ask | show | jobs
by kstrauser 113 days ago
In Python, that less hazardous string concatenation operator is an f-string.
1 comments

I’m assuming you can only use it with string literals, hence it is less universally useful.
Nope, you can put expressions in them:

f'{a} = {functionThatReturnsAButHasSideEffects()}'