參考答案不好啊,我感覺還是我這樣舒坦!
為啥要按照參考答案這樣來?我這樣也可以啊 --------?
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)
2021-01-11
就是打印的幾種方式,是用了看的那個知識點.其實沒啥
2021-01-11
到底什么意思
2021-01-08
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)