小册名称:Python合辑1-Python语言基础
<模版字符串{}>.format(<逗号分隔的参数>)
示例:
name = 'Tom'gender = 'male'age = 20print('姓名:{},性别:{},年龄:{}'.format(name,gender,age))# 输出:姓名:Tom,性别:male,年龄:20
name = 'Tom'
gender = 'male'
age = 20
print('姓名:{},性别:{},年龄:{}'.format(name,gender,age))
# 输出:姓名:Tom,性别:male,年龄:20