# 普通简单的方法
>>> name = 'python'
>>> 'Hello,%s' % name
'Hello,python'
>>> errno = 4567980
>>> '%x' % errno
'45b3ac'
# 使用format方法
>>> 'Hello, {}'.format(name)
'Hello, python'
>>> f'Hello, {name}!'
'Hello, python'
>>> a = 5
>>> b = 10
>>> f'Five plus ten is {a + b} and not {2 * (a + b)}.'
'Five plus ten is 15 and not 30.'
# 使用字符串模板template
>>> from string import Template
>>> t = Template('Hello, $name!')
>>> t.substitute(name=name) 'Hello, python!'