(Jan-26-2019, 06:16 PM)Clunk_Head Wrote: I like f-strings for their adherence to zop "simple is better than complex" and "practicality beats purity", and they are nice and fast. However, I am so used to using % substitution and I'm a bit curmudgeonly. I should make that transition as well. I guess I need to retrain my fingers to fing some f-strings in the future. One question about f-strings, can you print a single { in an f-string?
Actually, you are way behind. %-style is the oldest one. Then, there was str.format() method. And f-strings are newest addition. You may want to take a look at https://pyformat.info/
https://docs.python.org/3.7/library/stri...i-language
with f-strings you can do
>>> a = 3 >>> b = 5 >>> print(f'{a} + {b} = {a+b}') >>> 3 + 5 = 8and example how to print single {
>>> print('{{ this is {}'.format('example')) { this is example
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs