Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
kstrauser
3 months ago
|
parent
|
context
|
favorite
| on:
Python string literals are kinda funny
In Python, that less hazardous string concatenation operator is an f-string.
layer8
3 months ago
[ā]
Iām assuming you can only use it with string literals, hence it is less universally useful.
TZubiri
3 months ago
|
parent
[ā]
Nope, you can put expressions in them:
f'{a} = {functionThatReturnsAButHasSideEffects()}'
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: