logoalt Hacker News

layer8yesterday at 9:59 PM3 repliesview on HN

It’s unclear what the big advantage is over `print("Age: "+age)`. It’s even more characters, in that specific example.


Replies

mixmastamykyesterday at 10:31 PM

Toy examples aren’t the use case, rather multiple variables or expressions, perhaps with formatting (padding) as well.

f-string is shorter, less err prone, and faster for medium complexity or above.

kstrauseryesterday at 10:04 PM

If age is a number, that won’t work.

show 1 reply