学习字符串format()函数时,报错:ValueError: cannot switch from manual field specification to automatic field numbering

学习字符串format()函数,执行如下语句时报错:ValueError: cannot switch from manual field specification to automatic field numbering,意思为:值错误:无法从手动字段规范切换到自动字段编号

 

 

 

原来是因为自动编号和手动编号不能同时使用,所以我在最后一个花括号中填写数值后,再次执行,执行成功

 

posted @ 2020-07-04 19:04  举高高的00  阅读(3056)  评论(0编辑  收藏  举报