The F-String

Posted by Justin Lillico on Mon 24 June 2019

Image credit

Another way to concatenate strings.

Hi guys, sorry it's been a fortnight! I've been hella busy and still am so this is going to be short.

So I recently discovered the f-string in python.

a_string = " are pretty damned cool!"
print("f-strings" + a_string)

So I'm sure most of us are familiar with the above for good old string concatenation. If you are super tricky, you might even know…

a_string = " are pretty damned cool!"

These are both well and good, but I have recently learned of a method i enjoy more than both of these.

a_string = " are pretty damned cool!"

Simple. Concise. Beautiful.

Stay tuned for next week!