Y
Hacker News
new
|
ask
|
show
|
jobs
by
kstrauser
113 days ago
If age is a number, that won’t work.
1 comments
layer8
113 days ago
Admittedly I’m not so familiar with Python; it does work in Java. In that case, introducing a less hazardous string concatenation operator would seem more universally useful.
link
kstrauser
113 days ago
In Python, that less hazardous string concatenation operator is an f-string.
link
layer8
113 days ago
I’m assuming you can only use it with string literals, hence it is less universally useful.
link
TZubiri
112 days ago
Nope, you can put expressions in them:
f'{a} = {functionThatReturnsAButHasSideEffects()}'
link