格式化操作符%
2017-12-24 本文已影响0人
SoochowU
%
‘I have bought %d pencils' % 45
如果使用了多个格式化符,则第二个参数须为元组形式
'I bought %d pens and %d pencils yesterday' % (3,45)
%
‘I have bought %d pencils' % 45
如果使用了多个格式化符,则第二个参数须为元组形式
'I bought %d pens and %d pencils yesterday' % (3,45)