關于3-7Python的字符串format第三個代碼模板
我照著課程講義打的第三個示例指定{}的名字w,c,b,i 的程序運行代碼了一遍,報錯信息如下
Traceback?(most?recent?call?last): ??File?"index.py",?line?7,?in? ????result?=?template.format(w?=?world,?c?=?china,?b?=?beijing,?i?=?imoooc) NameError:?name?'imoooc'?is?not?defined
2025-04-15