How to print literal curly-brace characters in python string and use .format
In this post we will give you information about How to print literal curly-brace characters in python string and use .format. Hear we will give you detail about How to print literal curly-brace characters in python string and use .formatAnd how to use it also give you demo for it if it is necessary.
You need to wrap it with double curly braces {{ }} to print the literal curl-brace characters in a python string.
Here is an example:
name = " {{ Hello python }} {0}"print (name.format(101))
Output:
{ Hello python } 101
Another example:
name = " {{ Hello python }} {0} {1}"print (name.format(101,109))
Output:
{ Hello python } 101 109
Hope this code and post will helped you for implement How to print literal curly-brace characters in python string and use .format. if you need any help or any feedback give it in comment section or you have good idea about this post you can give it comment section. Your comment will help us for help you more and improve us. we will give you this type of more interesting post in featured also so, For more interesting post and code Keep reading our blogs