首先这个错误的意思是:在缩进的时候,使用了错误的空格和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. Oracle下Update语句

    Update更新 格式: update table _name(表名) set col_name(列名) =expr(表达式) where  conti(条件) 案例1: update 语法可以用新值 ...

  2. pta 习题集5-18 打印学生选课清单

    假设全校有最多40000名学生和最多2500门课程.现给出每门课的选课学生名单,要求输出每个前来查询的学生的选课清单. 输入格式: 输入的第一行是两个正整数:N(≤≤40000),为前来查询课表的学生 ...

  3. HDU_2586_How far away ?

    How far away ? Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)To ...

  4. javascript 知道这20个正则表达式,能让你少写1,000行代码

    正则表达式,一个十分古老而又强大的文本处理工具,仅仅用一段非常简短的表达式语句,便能够快速实现一个非常复杂的业务逻辑.熟练地掌握正则表达式的话,能够使你的开发效率得到极大的提升. 正则表达式经常被用于 ...

  5. Day03 javascript详解

    day03 js 详解 JavaScript的基础 JavaScript的变量 JavaScript的数据类型 JavaScript的语句 JavaScript的数组 JavaScript的函数 Ja ...

  6. spring自定义事务同步器(二):借助redisson实现自己的同步器

    1. 借助redis的java客户端redisson实现自己的事物同步器 @Override public void lockWithinCurrentTransaction(Object key) ...

  7. Mysql varchar 把默认值设置为null和空的区别

    '\0',这个表示空,需要消耗存储空间的.NULL,则表示连这个\0都没有. NULL,你可以近似理解为变量未赋值(定义了变量,但是未使用,变量不指向具体存储空间,因此,理论上不消耗存储空间),同时, ...

  8. t检验&z检验学习[转载]

    转自:https://blog.csdn.net/m0_37777649/article/details/74937242 1.什么是T检验? T检验是假设检验的一种,又叫student t检验(St ...

  9. 后台管理系统-使用AdminLTE搭建前端

    返回总目录<ABP项目实战-后台管理系统-目录> 安装AdminLte 我们通过Nuget包管理器安装AdminLte 引用三方组件 因为AdminLte使用到了很多三方的组件,所以我们需 ...

  10. ruby中的**

    在ruby中,**是乘方的意思.它是一个右结合性的运算.如下: 在多个乘方的时候,会先进行后面的乘方运算,结果作为指数再与前一位进行乘方运算.