Python f-Strings - Advanced String Formatting tutorial for beginners

preview_player
Показать описание

Learn how to use Python f-strings to format your strings in a less verbose way and with extra string formatting options. You may have used concatenation, percent signs, or the string format method before, but f-Strings are the current modern way to format strings in Python.

⭐ Become a full-stack dev with Zero To Mastery Courses:

👇 Follow Me On Social Media:

Python f-Strings tutorial for Beginners

(00:00) Intro
(00:05) Welcome
(00:14) How We've Been Inserting Values into Strings
(01:21) Formatting with percent signs
(03:44) The .format() method
(04:30) Why move on to f-Strings?
(10:06) f-Strings examples
(13:38) Passing format options
(18:43) Updating Rock Paper Scissors with f-Strings

📚 Tutorial References:

Was this Python f-Strings tutorial for beginners helpful? If so, please share. Let me know your thoughts in the comments.

#python #f-strings #strings
Рекомендации по теме
Комментарии
Автор

The string interpolation using f"string" way is very similar to the way dotnet do it, anyway, it uses the $ symbol instead of the F

I think numbers will be automatically converted to strings inside a formatted string so no need to str() them
Thanks Dave

ahmad-murery
Автор

18:15 all i see is emojis 🤣. thanks btw dave

muzhaffarhaydar
Автор

Thank you Dave ❤❤when will be the next video released?

mohammadnabil
Автор

It's almost like template litterals in Javascript. Great tutorial btw

lowcodehub
Автор

Looking at the 8:30 could it be true to say that Dave is a player? If player in Dave: "playa gunna play"...Thanks for the video

mooneymakes
Автор

person = "Dave"
word = "amazing"

message = "\n{name} is {quality} .".format(quality=word, name=person)
print(message)

LeonelLopezBorbon
Автор

Hello Dave Create Video in Blog page thank you Dave

mioszkordaczuk
Автор

Sir, in your python tutorial, Lesson 13
line number 33 and 34

print('\nYou chose ' + str(RPS(player)).replace("RPS.", '').title() + '.')
print('Python chose ' + str(RPS(computer)).replace("RPS.", '').title() + '.\n')

In this line of code that where from come .title( ) method. You never explained previous tutorial.
a little confusion.
It start from tutorial 8, rps2.
I also asked this question in your discord channel.

utinthein
Автор

I cry a little bit when I see a range from 1 to 11... lol.

thesorus