.format in strings

Hello,

I’ve been doing the python course and in some projects where i got stuck I watch the videos to understand what I’ve been doing wrong and I have crossed with this code

print("Something ${0}."format()

But I don’t get this, is this the same as f{} ?

Hello @systemace03928. There are multiple ways to format strings, both ways you have said are correct, but they are different ways of doing essentially the same thing. here is an article explaining the multiple ways of string formatting in Python.
I hope this helps!

1 Like