为了账号安全,请及时绑定邮箱和手机立即绑定

参考答案不好啊,我感觉还是我这样舒坦!

为啥要按照参考答案这样来?我这样也可以啊 -------- 

template = '{0}, {1}'

result = template.format('WorldLife is short', 'you need Python .')

print(result)


template = '{w}, {c}'

World = 'WorldLife is short'

you = 'you need Python .'

result1 = template.format(w = World, c = you)

print(result1)


正在回答

3 回答

就是打印的几种方式,是用了看的那个知识点.其实没啥

0 回复 有任何疑惑可以回复我~

到底什么意思

0 回复 有任何疑惑可以回复我~

template = '{0}, {1}'

result = template.format('WorldLife is short', 'you need Python .')

print(result)


template = '{w}, {c}'

World = 'WorldLife is short'

you = 'you need Python .'

result1 = template.format(w = World, c = you)

print(result1)


1 回复 有任何疑惑可以回复我~

举报

0/150
提交
取消

参考答案不好啊,我感觉还是我这样舒坦!

我要回答 关注问题
微信客服

购课补贴
联系客服咨询优惠详情

帮助反馈 APP下载

慕课网APP
您的移动学习伙伴

公众号

扫描二维码
关注慕课网微信公众号