F-Strings Are Even MORE Powerful Now In Python 3.12 #code #programming #python

preview_player
Показать описание
F-Strings are more powerful now in Python 3.12 #code #programming #python
Рекомендации по теме
Комментарии
Автор

It is extremely useful broh while dealing inline conditional statements or list compressions.

dipeshsamrawat
Автор

yet another wonderful improvement to disrupt and disorient code commit peers

fly-half-a-flash
Автор

I don't know if nested f strings are useful but the way the f-strings don't care about the type of quote anymore is amazing

k_gold
Автор

I don't think this feature is specifically about nesting f strings, it's for nesting strings in f strings. So for example this has been valid python for a while now:

f"Your shopping list is: {', '.join(shopping_list)}."

With this new feature, it is now valid syntax to write the inner string ', ' as ", " instead.

Daniel-nlug
Автор

What is the point of nesting f-strings?

Автор

Never had to cuz you can set them as variables and add them but it's probably good

AkivaB
Автор

Honestly the 1 + 1 = 2 result is just as important as the feature itself

parlor
Автор

The most case I have done is 2 layer of f-string which also have string in the inner f-string

Mystery_Glitch
Автор

Yo dawg, I heard you like f-strings, so we put f-strings in your f-strings so you can format while you format.

__christopher__
Автор

I've never had to use this. I usually just use a variable.

braydenmchan
Автор

Still have to try, but for example if you put in a f-string a call to a function that has a string as argument? I will check

johnstarfire
Автор

I don't see the benefit yet of nested f string in python.

asagiai