python错误提示“TabError: inconsistent use of tabs and spaces in indentation”
生活随笔
收集整理的這篇文章主要介紹了
python错误提示“TabError: inconsistent use of tabs and spaces in indentation”
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
打印奇數代碼如下:
觀察了很久但是卻找不出問題。后來在網上找到了答案。是空格和制表符混合的問題。
在notepad++中顯示制表符的步驟如下:
顯示后代碼格式如下:
將空格變為制表符后(如下)可以成功運行
總結
以上是生活随笔為你收集整理的python错误提示“TabError: inconsistent use of tabs and spaces in indentation”的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: python基础3(来自廖雪峰的官方网站
- 下一篇: python基础4(来自廖雪峰的官方网站