初学Python,遇到一个问题一直没解开:
Python Error: Inconsistent indentation detected! help can't find a fix?
When I run my code i got the above error and the following:
1)Your indentation is outright incorrect(easy to fix), OR
2)Your indentation mixes tabs and spaces
1)Your indentation is outright incorrect(easy to fix), OR
2)Your indentation mixes tabs and spaces
应为Python对格式对齐要求很严,所以应该是对齐的问题。
解决方法:在提示处用空格键修改对齐。
本文详细解释了Python中出现缩进错误的原因,并提供了两种可能的解决方案:一是直接修正不正确的缩进;二是确保代码中不混合使用Tab和空格进行缩进。
51万+

被折叠的 条评论
为什么被折叠?



