'Inserting variable into string, not working [duplicate]

So i am trying to put value inside this text

fp = str("""```yaml\nThe floor price is {floor_price} ETH.```""")

i tried the f string but it gives error

edit: i fixed with f string after trying for long



Solution 1:[1]

You can do it with the plus sign(+)

fp = "yaml\nThe floor price is " + str(floor_price) + " ETH."

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Mario Khoury