原文:Python報錯:TypeError: '<' not supported between instances of 'list' and 'int' (“<”在'list' 和 'int' 的實例之間不支持)

.示例代碼 .報錯截圖 .解決方法:將append修改為extend,extend可以將一個列表的元素逐一添加到另一個列表中,區別於append的整體添加,即第 行更改為:list .extend list ...

2022-02-24 11:40 0 3534 推薦指數:

查看詳情

 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM