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

    .WebRTC后台服务: 通话的房间服务器(Room Server) 房间服务器是用来创建和管理通话会话的状态维护,是双方通话还是多方通话,加入与离开房间等等,我们暂时沿用Google部署在GAE平台 ...

  2. angular js 上传插件 ng-file-upload 使用时注意事项

    项目框架为angular js,需要用到文件上传,百度之后先选择了angular-file-upload,githuab上API文档很全,想要具体了解,可以仔细研究一下.在这里简单回顾一下自己使用的插 ...

  3. spring boot由浅入深(一)jdk安装

    1jdk说明 jdk是java提供了运行环境,简单的说就是给java语言制定了规则,并且提供了工具 jdk官网网站:http://www.oracle.com/technetwork/java/jav ...

  4. 欧盟GDPR通用数据保护条例-原文

    GDPR英文原文 https://eur-lex.europa.eu/legal-content/EN/TXT/?uri=uriserv:OJ.L_.2016.119.01.0001.01.ENG&a ...

  5. editplus的常用快捷键

    小编给大家整理了一些软件的快捷键.http://www.downza.cn/soft/187814.html 创建当前行的副本:Ctrl+J 反转选定文本的大小写:Ctrl+K 选择当前行:Ctrl+ ...

  6. 为什么Log.nsf中存储的日志只有最近7天的原因

    是由于Domino服务器的notes.ini配置文件中有一行参数: Log = logfilename, log_option, not_used, days, size 比如:Log=log.nsf ...

  7. HTML5-Canvas 图形变换+状态保存

    1. 图形变换 canvas是基于状态绘制图形的.故此一般情况下,canvas的绘制的图形路径和状态时分离的. function drawShape(ctx){ // 绘制路径 shapePath(c ...

  8. mac终端显示日历信息命令

    cal 命令: 用法: usage: cal [-jy] [[month] year] cal [-j] [-m month] [year] ncal [-Jjpwy] [-s country_cod ...

  9. Java基础知识Set、List、Map的区别

    就学习经验,浅谈Java中的Set,List,Map的区别,对JAVA的集合的理解是相对于数组: 数组是大小固定的,并且同一个数组只能存放类型一样的数据(基本类型/引用类型),JAVA集合可以存储和操 ...

  10. 70. Climbing Stairs(动态规划 爬台阶,一次只能爬1,2两节)

    You are climbing a stair case. It takes n steps to reach to the top. Each time you can either climb ...