在編輯器內(nèi)單獨(dú)運(yùn)行都對(duì)啊,在網(wǎng)頁內(nèi)運(yùn)行錯(cuò)誤,為什么?
#方法1 template="Life is short,{} " data="you need Python." result=template.format(data) print(result)
#方法2 template="Life is short,{a} " short="you need Python." result=template.format(a=short) print(result)??
2021-03-21
template="Life is short,{} "?
data="you need Python."
result=template.format(data)?
print(result)
不要全部寫在一行啊
2021-03-26
謝謝,解決了