在编辑器内单独运行都对啊,在网页内运行错误,为什么?
#方法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)
#方法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
举报