The format() method formats the specified value(s) and insert them inside the string's placeholder.
The placeholder is defined using curly brackets: {}. Read more about the placeholders in the Placeholder section below.
The format() method returns the formatted string.
f-string:
To create an f-string, prefix the string with the letter “ f ”. The string itself can be formatted in much the same way that you would with str.format(). F-strings provide a concise and convenient way to embed python expressions inside string literals for formatting.
Python for Absolute Beginners in English Playlist: • Python for Absolute Beginnners in English
Connect with me on:
Facebook
LinkedIn
Github
Instagram