python expected an indented block什么意思
来源:互联网 发布:西华大学点击网络图片 编辑:程序博客网 时间:2024/05/01 13:53
1、不像其他语言(C++, java 等等),python的是用缩进来识别语法逻辑块的(i.e. if, while, for, def 等)。同一个if逻辑块下面的语句必须要有相同的缩进,否则python解析器怎么知道if块控制哪些语句?
2、所谓缩进,就是每一行开头的空白。这个空白可以由多个空格或者制表符组成。python下面你怎么缩进都可以,比如3个空格,2个tab,这样都是合法的。但是同一个逻辑块下面必须用一样的。一般来说,我们推荐2空格缩进。(而不是用tab缩进,原因是tab在不同编辑器下显示的空白长度不一致会带来很多问题)
阅读全文
0 0
- python expected an indented block什么意思
- Python expected an indented block
- python:IndentationError:expected an indented block
- python IndentationError: expected an indented block
- Python问题-IndentationError: expected an indented block
- 【Python】异常:IndentationError:expected an indented block
- python错误:IndentationError:expected an indented block
- python:IndentationError:expected an indented block
- python IndentationError: expected an indented block
- Python中expected an indented block
- Python 错误:IndentationError: expected an indented block
- Python错误:IndentationError: expected an indented block
- python:IndentationError:expected an indented block问题
- Python : expected an indented block错误
- IndentationError:expected an indented block
- IndentationError: expected an indented block
- Python_IndentationError:expected an indented block
- Python常见问题解决办法之:python indentationerror:expected an indented block
- 1011. A+B和C (15)
- springmvc、mybatis分页+pagehelper的使用(包括页面代码)
- <context:component-scan>详解
- 狗年出生的宝宝取名都有哪些注意事项呢?起名真不是简单事
- HDU
- python expected an indented block什么意思
- sax和dom对xml的区别
- Python3.5基础——NumPy模块的使用(下)
- rsyslog 入门 第二篇 imfile omfile
- HQL查询最大值
- glut常用库函数
- 框架:Mybatis
- jquery的load方法详解
- 树莓派开启samba服务