为啥要按照参考答案这样来?我这样也可以啊 --------
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)