Python IndentationError
来源:互联网 发布:在线网络投资产品排行 编辑:程序博客网 时间:2024/06/14 10:27
Python写完之后最讨厌的就是书写格式有误,今天分享一下:
#!/usr/bin/python# -*- coding: UTF-8 -*- if true: print "***********"else: print "Answer" print "False"
# 没有严格缩进,在执行时会报错IndentationError: unindent does not match any outer indentation level
IndentationError: unexpected indent 错误是 python 编译器是在告诉你"你的文件里格式不对了,可能是tab和空格没对齐的问题",所有 python 对格式要求非常严格。如果是 IndentationError: unindent does not match any outer indentation level错误表明,你使用的缩进方式不一致,有的是 tab 键缩进,有的是空格缩进,改为一致即可。因此,在 Python 的代码块中必须使用相同数目的行首缩进空格数。建议你在每个缩进层次使用 单个制表符 或 两个空格 或 四个空格 , 切记不能混用
阅读全文
1 0
- python--IndentationError:
- python IndentationError:
- Python IndentationError
- IndentationError: unexpected indent python
- IndentationError: unexpected indent python
- python中IndentationError
- IndentationError: unexpected indent python
- IndentationError: unexpected indent python
- python:IndentationError: unexpected indent
- IndentationError: unexpected indent python
- python错误之IndentationError
- Python中遇到IndentationError
- IndentationError: unexpected indent python
- Python IndentationError 问题
- Python的IndentationError: unexpected indent
- 【Python】关于递进错误indentationerror
- python错误:IndentationError: unexpected indent
- python报"IndentationError: unexpected indent"
- 名称空间
- c++ 中子类与父类构造析构的调用和顺序
- C# 方法的定义
- Ubuntu Server 16.04 安装MySQL
- JAVA mail邮箱发送信息
- Python IndentationError
- allegro学习之反馈电流走线宽度
- Leetcode#66: Plus One
- 如何下载淘宝视频
- .net分页控件webdiyer:aspnetpager与gridview联用
- 开通博客了
- Struts2 result各种转发类型
- 将语句中的单词扣出来,并排序的wordSearch类
- android 原生Sqlite使用总结