问答详情
源自:3-7 Python的字符串format

why ?imooc换shunyi不行?

result=template.format(w=world,c=china,b=beijing,s=shunyi)

Traceback (most recent call last):

  File "<stdin>", line 1, in <module>

NameError: name 'shunyi' is not defined. Did you mean: 'sunyi'?


提问者:weixin_慕数据0105977 2023-07-14 16:28

个回答

  • 慕少1536510
    2023-07-15 20:05:24

    shunyi=template=result = template.format(=,=,=,=shunyi,=)
    (result)