View this post on Hive: [Python Tips] f-strings in Python 3.6 and why you should be using them
[Python Tips] f-strings in Python 3.6 and why you should be using them
7 years ago by themarkymark (78)
$84.51
- Past Payouts $84.51
- - Author $74.32
- - Curators $10.19
161 votes
- + upmyvote: $31.304 (64.52%)
- + ipromote: $18.158 (100%)
- + jerrybanfield: $14.806 (24.8%)
- + zahnspange: $1.651 (25%)
- + nextgencrypto: $1.635 (16%)
- + thecyclist: $1.530 (16%)
- + knozaki2015: $1.339 (25%)
- + ozchartart: $1.196 (16%)
- + hairshares: $1.120 (100%)
- + romedog: $0.870 (25%)
- + b0y2k: $0.855 (25%)
- + engagement: $0.675 (16%)
- + anyx: $0.644 (20%)
- + alexpmorris: $0.620 (80%)
- + thedelegator: $0.524 (16%)
- + michellectv: $0.472 (80%)
- + cryptogee: $0.447 (100%)
- + themarkymark: $0.385 (100%)
- + yougotflagged: $0.354 (16%)
- + aizensou: $0.290 (25%)
- … and 141 more
Cool I’ll try that out with “”” strings which have been coming in handy a lot lately
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
This is a really good tip, I am just starting to learn some Python. F-strings are going to save me so much time 😬
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
These remind me of those
which are pretty neat. It's nice to see that they are also in Python. Another reason to give it a try, since I've been neglecting it for a while in favour of JS.
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Thank you, I try to support specific code examples and technique advice whenever I have voting power to offer. Keep them coming, I will have to give this method of string formatting a try, adding error handling of sorts to the example would be of value, as during runtime I presume errors are likely.
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
thank you nice blog nice post sharing.
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
a very great post I really like a friend. please help me friend.
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
I have no idea what I just read lol but I'll let Frank (@fstmaurice) know about f-strings. He writes code, so he'll understand this language. In my mind, I'm thinking F for Frank, f-strings, fffffff, and then my mind went to farts.
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
I always knew I was going to be rich. I don't think I ever doubted it for a minute.
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Very interesting, very useful ..
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Something very useful ..
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Why should I be using f strings?
Next time it would be cool if you could show the examples and resulting ouput in the Python 2.7 and 3.6 interpreter shells. Thanks for quick read, I work with Python so this is interesting.
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
I don’t touch 2.7.
The post is pretty clear of the two advantages.
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
I've just read two of your python posts and learnt something new in both of them! I never even realized you were a programmer! Anyway, thanks for this, I've set a follow on you
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
I’m not, but I do code. :)
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
It should be called "string interpolation". Ruby has it, too.
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Ha that's awesome, I've been using python 2.6/2.7 mostly due to the version that graphics applications use. So hadn't known about this in python 3.6, that's just lovely :D
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
A lot of people still use 2.7 but 3 is the way to go. Most everything has been moved over now. I know Google still uses 2.7 a lot but they have a ton of custom systems they need to migrate.
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit