Python's f-strings! - Friday Minis 317

preview_player
Показать описание
As of Python 3.6 (which, admittedly, is several years old), you can now do string substitutions with less effort! Instead of using .format() or the % operator, you can now just mention the required variables inline!

= CREDITS =
My appreciation extends to the creators of the following external assets that made this video possible:
Licensed under Creative Commons: By Attribution 3.0
ISRC: USUAN1200100

= 0612 TV =

Enjoy your stay, and don't hesitate to drop me a comment or a personal message to my inbox =) If you like my work, don't forget to subscribe!



= NERDfirst =
NERDfirst is a project allowing me to go above and beyond YouTube videos into areas like app and game development. It will also contain the official 0612 TV blog and other resources.


-----

Disclaimer: Please note that any information is provided on this channel in good faith, but I cannot guarantee 100% accuracy / correctness on all content. Contributors to this channel are not to be held responsible for any possible outcomes from your use of the information.
Рекомендации по теме
Комментарии
Автор

Cool, and good to know. Good presentation. I'm still going to continue to use .format as I like to keep data/contents separate from presentation like CSS offers in Web development. _print( "Presentation and {}".format( "data/contents.") )_

k.chriscaldwell
Автор

Thank you for the content. Do you need to import any library to use f strings or is it inbuilt ?

sashikiran
Автор

Bro that's cool tutorial and cool channel name.

jay-rathod-
Автор

Very good video explaining the topic. I think every programming language should have some form of string interpolation.

But you also added a little mistake in the video. You said "You can put any statement in here". Examples for statements are: if statements or while statements. Those things don't have a value where on the other hand "expressions" like x*2 or list (comprehension) expressions have a value. It's a minor knit pick and it was obvious what what you meant but just wanted to get the terminology correct.

mamazu