What is an 'f-string'?

Asked by emeka_nwankwo · 2 weeks ago

1 Answer

41
amorebise · 2 weeks ago Top Answer

f-strings are a modern and easy way to put variables inside text. You put an 'f' before the quotes and the variable inside curly brackets {}.

f"Price is {cost} Naira". It’s much cleaner than using the + sign everywhere. I highly recommend using them; they make your code look professional.

Log in to add a comment.