0

I want to achieve something similar to:

user = "The Great User"
text = "Hello {%s}" % user

Output:Hello {The Great User}

but using .format(). How do I do this? (Note I want brackets around the user)

DarcliGht
  • 1,399
  • 2
  • 10
  • 14
  • 2
    To adapt the duplicate to your situation: use `"Hello {{{}}}".format(user)`; you need *doubled* curly braces to include them as literal text, and you need the `{}` placeholder. – Martijn Pieters Sep 30 '16 at 13:00
  • Opps. I was just being stupid. But I will leave the question as it is if someone else gets stupid ;) And Thanks. – DarcliGht Sep 30 '16 at 13:04

0 Answers0