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


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

 

 

 

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

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM