the_tops
2021-01-08 16:13
为啥要按照参考答案这样来?我这样也可以啊 --------
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)
就是打印的几种方式,是用了看的那个知识点.其实没啥
到底什么意思
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)
Python3 入门教程(新版)
154160 学习 · 1075 问题
相似问题