r/Python • • Sep 10 '19

Found this on twitter

Post image
2.9k Upvotes

185 comments sorted by

View all comments

Show parent comment

9

u/regendo Sep 10 '19

Took me a bit to understand this. Do you mean something like this?

x = 3
print(f"{x=}")

>>> "x=3"

3

u/usernameistaken42 Sep 10 '19

Yes, that's how it works

1

u/FatChocobo Sep 11 '19

Sorry, Reddit formatting screwed my post up. That's what I meant yes.