首先这个错误的意思是:在缩进的时候,使用了错误的空格和tab
我使用的python3.5,造成这个错误的原因是我在函数里面敲if....elif 判断语句的时候,elif之前先用了空格然后再用tab完成了对齐,也就是说,这种错误产生的原因正是由于空格或者tab缩进造成的。
然后我做了试验,将空格删除,直接使用tab完成缩进,发现程序正常运行;
再试一下空格缩进,然后发现还是报错了,同样TabError: Inconsistent use of tabs and spaces in indentation。
 
也就是说,python3.5是要用tab完成缩进的,而且不能使用空格,否则会报错

python运行错误---TabError: Inconsistent use of tabs and spaces in indentation的更多相关文章

  1. Python文件运行时报TabError: inconsistent use of tabs and spaces in indentation

    1. 问题描述 Python文件运行时报TabError: inconsistent use of tabs and spaces in indentation 2. 问题原因 tab 和 space ...

  2. python 报错 TabError: inconsistent use of tabs and spaces in indentation

    写python的时候如果出现如题的错误 TabError: inconsistent use of tabs and spaces in indentation 意为:制表符错误:缩进中制表符和空格使 ...

  3. Python程序调试-TabError: inconsistent use of tabs and spaces in indentation

    报错信息:TabError: inconsistent use of tabs and spaces in indentation 说明:代码缩进统一使用Tab键或空格键,不能混用. 解决办法: 1. ...

  4. Python中出现“TabError: inconsistent use of tabs and spaces in indentation”问题的解决

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

    在遍历打印10以内的奇数是出现“TabError: inconsistent use of tabs and spaces in indentation”的错误提示: 代码如下: 第一感觉没什么错误, ...

  6. 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 这是我的代码,感觉没啥不对, 后来运行之后出现了下面的错误,我也是弄了好久 ...

  7. 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 ...

  8. PyCharm出现TabError: inconsistent use of tabs and spaces in indentation最简单实用的解决办法

    本文使用PyCharm的格式化代码功能解决TabError: inconsistent use of tabs and spaces in indentation. 当把代码从别处复制进来PyChar ...

  9. vscode 遇到 TabError: inconsistent use of tabs and spaces in indentation

    Python开发,全靠缩进来控制Scope.缩进搞错了,代码也就有问题了.所以写着代码的时候,总是会遇到一个非常常见的问题.TabError: inconsistent use of tabs and ...

随机推荐

  1. Kafka Consumer接口

    对于kafka的consumer接口,提供两种版本,   high-level 一种high-level版本,比较简单不用关心offset, 会自动的读zookeeper中该Consumer grou ...

  2. Qt:QPushButton 单击、双击响应区分

    开发环境:win10+vs2015+qt5.9.1 背景:QPushButton的双击事件虽然一直有,但是在双击完成之前,总会响应到单击的事件处理或者连接槽,使用很不方便.自己子类化了一个QPushB ...

  3. python __init__ 构造函数

    实例化过程 会执行__init__ 的函数方法 class SQLHelper: def __init__(self): # self = s1 print("helo") def ...

  4. windos 查看指定端口,将指定进程杀死

    >netstat -aon | findstr “80″ Proto   Local Address           Foreign Address         State        ...

  5. django之中间件、缓存、信号、admin内置后台

    目录: 中间件 缓存 信号 admin后台 一.中间件 1.什么是中间件? 中间件是一个.一个的管道,如果相对任何所有的通过Django的请求进行管理都需要自定义中间件 中间件可以对进来的请求和出去的 ...

  6. Spark Shuffle调优原理和最佳实践

    对性能消耗的原理详解 在分布式系统中,数据分布在不同的节点上,每一个节点计算一部份数据,如果不对各个节点上独立的部份进行汇聚的话,我们计算不到最终的结果.我们需要利用分布式来发挥Spark本身并行计算 ...

  7. PAT 1142 Maximal Clique[难]

    1142 Maximal Clique (25 分) A clique is a subset of vertices of an undirected graph such that every t ...

  8. 编程当道,学点Python技术好傍身

    为了填满AI时代的人才缺口,编程语言教育都从娃娃抓起了!如果你还不懂Python是什么将来怎么给孩子辅导作业呢? Python新手入门教程 近期,浙江省信息技术课程改革方案出台,Python言语现已断 ...

  9. jmeter dubbo接口测试

    说在前面,测试熔断降级系统时,要求测试一下对应的dubbo接口性能 1.安装Jmeter 2.将dubbo依赖包下载好放在jmeter路径/lib/ext下, 3.打开jmeter,测试计划下新建线程 ...

  10. c++第十九天

    p109~p110: C风格字符串 特点: 1.不方便,不安全,尽量不使用. 2.必须以 '\0'结束.(只有这样才能使用C风格字符串函数) 3.一般利用指针操作这些字符. 4.可以用字符串字面值来初 ...