python错误提示“TabError: inconsistent use of tabs and spaces in indentation”

时间:2017-07-03 17:01:49   收藏:0   阅读:4814

 在遍历打印10以内的奇数是出现“TabError: inconsistent use of tabs and spaces in indentation”的错误提示:

技术分享

代码如下:

 技术分享

第一感觉没什么错误,但是当我设置显示“空格与制表符”时候,问题出现了,在第4、5行前由制表符,如图所示:

技术分享

 

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

解决问题重新运行,结果OK。

技术分享

亲测好使。。。

 

原文:http://www.cnblogs.com/zjiacun/p/7111915.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!