學習字符串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