Reputation: 4209
By using print("""{{1}} {}""".format("x"))
I want to print this:
{{1}} x
But I get this:
{1} x
But after using print("""{{{1}}} {}""".format("x"))
(three brackets rather than two) I get IndexError: tuple index out of range
So how can I print double brackets using .format on it? Thanks in advance.
Upvotes: 1
Views: 1065
Reputation: 148
Quadruple brackets print("""{{{{1}}}} {}""".format("x"))
as double bracket prints one bracket in output so 4 prints two
Upvotes: 2