from string import Template name = "Ashish" age = 27 template = Template("My name is $name and I am $age years young.") print(template.substitute(name=name, age=age)) #Output: My name is Ashish and I am 27 years young. Next, use the substitute method to print the string. Instantiate this class using a string that contains placeholders that start with the $ character. Enter your admin name and password to open the app. This is done by importing the Template Class from the string module. MacOS X Package: If you see a warning 'Texmaker.app can't be opened because the developer cannot be verified' : control-click the texmaker.app in Finder, choose Open from the menu, and then click Open in the dialog that appears. Num = 32 print(“The hex value of %s is %x.” %(num, num)) #Output: The hex value of 32 is 20. ![]() ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |