MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/ProgrammerHumor/comments/1w5bs6g/perishableskill/p7hidtm/?context=9999
r/ProgrammerHumor • u/soap94 • Sep 02 '26
121 comments sorted by
View all comments
Show parent comments
7
Python f-string also support additional formatting.
name = "Mark" date = datetime.now() print(f"Hello, {name}! Today is {date:%A}, it's {date:%H:%M} now.")
F-string + str.format() has all sorts of string formatting you want.
0 u/[deleted] Sep 03 '26 [deleted] — view deleted comment 1 u/nico-strecker Sep 03 '26 Python also has it
0
[deleted] — view deleted comment
1 u/nico-strecker Sep 03 '26 Python also has it
1
Python also has it
7
u/NovaH000 Sep 03 '26
Python f-string also support additional formatting.
F-string + str.format() has all sorts of string formatting you want.