首页
技术博客
登录
6mi
u
盘
搜
搜 索
技术博客
‘{ }‘.format()的总结
‘{ }‘.format()的总结
tech
2022-07-16
194
# 元组传值 print('my name is {}, age is {}'.format('lala',22)) # 列表传值 li = ['chenpeng',22] print('my name is {}, age is {}'.format(*li)) # 字典传值 hash = {'name':'chenpeng', 'age':20} print('my name is {name}, age is {age}'.format(**hash))
转载请注明原文地址:https://tech.qufami.com/read-949.html
最新回复
(
0
)