TabError: inconsistent use of tabs and spaces in indentation

小鲨鱼2018 / 2023-07-11 / 原文

 

001、python程序报错如下:

 

002、报错原因(看着缩进是一样的,实际上是不一样的

 

003、解决方法

将缩进统一调整为tab键, 对齐即可。

 

参考:https://blog.51cto.com/yunyaniu/4724938