代码:
studentInfo= {
'张三' : 18,
'李四' : 17,
'王五' : 16,
'马尚' : 18,
'刘波' : 19,
}
def printAge(*students) :
for iin students:
print( f'学生%s,年龄{studentInfo[i]}' %i)
printAge('李四', '王五', '刘波')
studentInfo= {
'张三' : 18,
'李四' : 17,
'王五' : 16,
'马尚' : 18,
'刘波' : 19,
}
def printAge(*students) :
for iin students:
print( f'学生%s,年龄{studentInfo[i]}' %i)
printAge('李四', '王五', '刘波')
本文标题:python字典类型%s字符串格式化输出
本文链接:https://www.haomeiwen.com/subject/lmfifdtx.html
网友评论