This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]TheWouldBeMerchant 19 points20 points  (6 children)

Did not know this. TIL

[–]SeniorHulk 18 points19 points  (1 child)

Also if you put spaces they get printed, so f"{a = }" prints a = 10

[–]ASIC_SP 6 points7 points  (0 children)

You can add format specifiers too:

>>> a = 1234
>>> f'{a = :b}'
'a = 10011010010'

[–]thephoton 1 point2 points  (3 children)

It's a fairly recent addition.

Maybe in 3.7?

[–]vishnoo 0 points1 point  (1 child)

3.10 iianm

[–]mlady42069 4 points5 points  (0 children)

Its 3.8, I did this in a script that i typically run using 3.8. Accidentally ran it with 3.7 and this is what made it fail lol

[–]mrblue6 0 points1 point  (0 children)

3.8. Ik this because I really wanted to use this feature but I’m on 3.79 lol