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

代码如下:

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

在if和continue前有制表符,所以执行的时候会提示“TabError: inconsistent use of tabs and spaces in indentation”
解决问题重新运行,结果OK。

亲测好使。。。
python错误提示“TabError: inconsistent use of tabs and spaces in indentation”的更多相关文章
- python 报错 TabError: inconsistent use of tabs and spaces in indentation
写python的时候如果出现如题的错误 TabError: inconsistent use of tabs and spaces in indentation 意为:制表符错误:缩进中制表符和空格使 ...
- Python程序调试-TabError: inconsistent use of tabs and spaces in indentation
报错信息:TabError: inconsistent use of tabs and spaces in indentation 说明:代码缩进统一使用Tab键或空格键,不能混用. 解决办法: 1. ...
- Python中出现“TabError: inconsistent use of tabs and spaces in indentation”问题的解决
- python运行错误---TabError: Inconsistent use of tabs and spaces in indentation
本文转载于:http://blog.csdn.net/sinat_36384705/article/details/71155379 首先这个错误的意思是:在缩进的时候,使用了错误的空格和tab 我使 ...
- Python文件运行时报TabError: inconsistent use of tabs and spaces in indentation
1. 问题描述 Python文件运行时报TabError: inconsistent use of tabs and spaces in indentation 2. 问题原因 tab 和 space ...
- Python之TabError: inconsistent use of tabs and spaces in indentation和ModuleNotFoundError:No module named 'win32api'
1.TabError: inconsistent use of tabs and spaces in indentation 这是我的代码,感觉没啥不对, 后来运行之后出现了下面的错误,我也是弄了好久 ...
- Python使用4个空格替换Tab, TabError: inconsistent use of tabs and spaces in indentation。
问题:以前使用Pycharm和VsCode没遇到问题,使用nodepat++老是提示Tab异常 TabError: inconsistent use of tabs and spaces in in ...
- vscode 遇到 TabError: inconsistent use of tabs and spaces in indentation
Python开发,全靠缩进来控制Scope.缩进搞错了,代码也就有问题了.所以写着代码的时候,总是会遇到一个非常常见的问题.TabError: inconsistent use of tabs and ...
- PyCharm出现TabError: inconsistent use of tabs and spaces in indentation最简单实用的解决办法
本文使用PyCharm的格式化代码功能解决TabError: inconsistent use of tabs and spaces in indentation. 当把代码从别处复制进来PyChar ...
随机推荐
- LeetCode OJ-- Sqrt(x) *
https://oj.leetcode.com/problems/sqrtx/ 求一个数的开方,二分查找一个数,直到这个数的平方 - target 小于 0.001. 但这道题出的不好,返回值竟然是 ...
- HDU 5266 pog loves szh III(区间LCA)
题目链接 pog loves szh III 题意就是 求一个区间所有点的$LCA$. 我们把$1$到$n$的$DFS$序全部求出来……然后设$i$的$DFS$序为$c[i]$,$pc[i]$为$c ...
- SpringCloud 分布式事务解决方案
目录 TX-LCN分布式事务框架 TX-LCN分布式事务框架 随着互联化的蔓延,各种项目都逐渐向分布式服务做转换.如今微服务已经普遍存在,本地事务已经无法满足分布式的要求,由此分布式事务问题诞生. 分 ...
- 松鼠的新家(lca)
洛谷—— P3258 [JLOI2014]松鼠的新家 题目描述 松鼠的新家是一棵树,前几天刚刚装修了新家,新家有n个房间,并且有n-1根树枝连接,每个房间都可以相互到达,且俩个房间之间的路线都是唯一的 ...
- POJ 1860 Currency Exchange 最短路+负环
原题链接:http://poj.org/problem?id=1860 Currency Exchange Time Limit: 1000MS Memory Limit: 30000K Tota ...
- 某考试 T3 bitboard
bitboardDiscription 天才发明家小K 制造了一块比特板.板子上有2^n个比特元,编号为0 ∼ 2^n−1.每个比特元
- [HEOI2015]定价
题目描述 在市场上有很多商品的定价类似于 999 元.4999 元.8999 元这样.它们和 1000 元.5000 元和 9000 元并没有什么本质区别,但是在心理学上会让人感觉便宜很多,因此也是商 ...
- openfire Android学习(五)------连接断开重连
首先要创建连接监听器,用来监听连接状态,这里我写了一个类 继承了ConnectionListener,重写了里面5个方法,最重要的两个方法connectionClosed()和connectionCl ...
- Android -- 开机启动无界面后台程序
简单的说,这是一个没有界面的后台运行的应用程序 而且,还有一功能:开机自启动,启动运行一个服务 程序结构非常简单,两个类,一个是service的扩展类,一个是BroadcastReceiver扩展类 ...
- 浮窗WindowManager view返回和Home按键事件监听
出于功能需求,需要在所有的view之上显示浮窗,于是需要在WindowManager的View上处理返回键的响应, mFloatingWindowView = layoutInflater.infla ...