Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

string template python

from string import Template
poem = Template('$x are red and $y are blue')

print(poem.substitute(x='roses', y='violets'))
#>>>roses are red and violets are blue
 
PREVIOUS NEXT
Tagged: #string #template #python
ADD COMMENT
Topic
Name
9+7 =