python报错:unindent does not match any outer indentation level

当遇到unindent does not match any outer indentation level的错误。发生错误的原因一般有三点:
1、代码前后缩进量不同

2、前后缩进符号不同

3、复制的代码导致tab与space混用

 如下图所示问题,可以将代码复制到notepad会更加直观清晰。 首先要将notepad设置好,当然为了避免上述第三种情况,最好设置显示空格与制表符。点击视图->显示符号->显示空格与制表符

 接着将代码复制到notepad,代码的缩进是否符合规范一目了然。可以看到刚刚导致报错的原因正是第一句代码前面的空格。

 

  • 2
    点赞
  • 13
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
c语言编译程序 Version 4.9.9.1 * Many bug fixes * Improved editor Version 4.9.9.0 * Support for latest Mingw compiler system builds * Bug fixes Version 4.9.8.9 * New code tooltip display * Improved Indent/Unindent and Remove Comment * Improved automatic indent * Added support for the "interface" keyword * WebUpdate should now report installation problems from PackMan * New splash screen and association icons * Improved installer * Many bug fixes Version 4.9.8.7 * Added support for GCC > 3.2 * Debug variables are now resent during next debug session * Watched Variables not in correct context are now kept and updated when it is needed * Added new compiler/linker options: - Strip executable - Generate instructions for a specific machine (i386, i486, i586, i686, pentium, pentium-mmx, pentiumpro, pentium2, pentium3, pentium4, k6, k6-2, k6-3, athlon, athlon-tbird, athlon-4, athlon-xp, athlon-mp, winchip-c6, winchip2, k8, c3 and c3-2) - Enable use of processor specific built-in functions (mmmx, sse, sse2, pni, 3dnow) * "Default" button in Compiler Options is back * Error messages parsing improved * Bug fixes Version 4.9.8.5 * Added the possibility to modify the value of a variable during debugging (right click on a watch variable and select "Modify value") * During Dev-C++ First Time COnfiguration window, users can now choose between using or not class browser and code completion features. * Many bug fixes Version 4.9.8.4 * Added the possibility to specify an include directory for the code completion cache to be created at Dev-C++ first startup * Improved code completion cache * WebUpdate will now backup downloaded DevPaks in Dev-C++\Packages directory, and Dev-C++ executable in devcpp.exe.BACKUP * Big speed up in function parameters listing while editing * Bug fixes Version 4.9.8.3 * On Dev-C++ first time configuration dialog, a code completion cache of all the standard include files can now be generated. * Improved WebUpdate module * Many bug fixes Version

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值