logoalt Hacker News

andaiyesterday at 8:28 PM2 repliesview on HN

age = 32

print(f"Age: {age}")

Thus concludes the lecture on f-strings.


Replies

kzrdudeyesterday at 9:31 PM

I find it funny and satisfying that Python has converged to it's own "printf", by which I mean print(f"").

layer8yesterday at 9:59 PM

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

show 3 replies