Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #String interpolation
- from __future__ import print_function #Compatibilidade func print python 2/3
- s = '%s was born in the %s.'
- print ( s %('Guido', 'Netherlands'))
- #Now, with Python PEP 292 (Simpler String Substitutions):
- from string import Template
- s = Template('${name} was born in the ${country}.')
- print (s.substitute(name='Guido', country='Netherlands'))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement