请老师解答
# Enter a code
template='Life is short,you need {P}'
ch='python'
result=template.format(P=ch)
print(result)
#这里,为什么不能直接给P赋值呢?
# Enter a code
template='Life is short,you need {P}'
P='python'
result=template.format(P)
print(result)
#这个程序为什么会出错呢?