【转载】Python问题定位:TabError: Inconsistent use of tabs and spaces in indentation

https://www.cnblogs.com/doublesnow/p/8654882.html

这个错误是说你用了tab键作缩进了,因为在python不像C/C++里用大括号来区分程序块,而是用缩进, 所以缩进很重要你把Tab都换成空格就好了 

可以把代码放到Notepad++上,然后 勾选 视图->显示符号->显示空格与制表符,如果代码中显示的由最左边的箭头形式的话,说明有tab键

【转载】Python问题定位:TabError: Inconsistent use of tabs and spaces in indentation

替换方式:在NotePad++中,点击 编辑->空白字符操作->TAB转空格  ,即可完成全部的转化,然后将代码放入Pycharm或者别的工具中进行编译

【转载】Python问题定位:TabError: Inconsistent use of tabs and spaces in indentation

 

分类: Python

相关文章:

  • 2021-11-22
  • 2021-07-12
  • 2021-10-02
  • 2021-07-02
  • 2021-06-13
  • 2021-12-25
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-09-25
  • 2021-06-04
  • 2022-01-13
  • 2021-06-04
  • 2021-09-06
  • 2021-09-12
相关资源
相似解决方案