python錯誤提示“TabError: inconsistent use of tabs and spaces in indentation”


 在遍歷打印10以內的奇數是出現“TabError: inconsistent use of tabs and spaces in indentation”的錯誤提示:

代碼如下:

 

第一感覺沒什么錯誤,但是當我設置顯示“空格與制表符”時候,問題出現了,在第4、5行前由制表符,如圖所示:

 

在if和continue前有制表符,所以執行的時候會提示“TabError: inconsistent use of tabs and spaces in indentation”

解決問題重新運行,結果OK。

親測好使。。。

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



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