📝 Basic Python: Make the String Beautiful with f-String! 🌟
After we learned String Concatenation with a + sign, today I propose a much more modern and easy way to insert variable values into String, which is f-Strings! ✨
F-String stands for Formatted String Literal is the best way to Format String since Python 3.6.
💡 Simple f-String Method:
1. Prefixed with f: The first thing we need to do is put the letter f or F in front of the quotation mark (Single Quote 'or Double Quote') of the String, such as f. ".."
2.Use {} as a Placeholder: Where we want to insert a variable or result from a calculation, let us put that in the brace {}!
F-String is very useful because it makes our code easier to read (Readable) and type less than connecting a String with a + sign!
Try to use it and be comfortable with the f-String! Keep going. 🥰





























































































