Python question: indentationerror:expected an indented block error resolution "Turn"

Source: Internet
Author: User

python problem: indentationerror:expected an indented block error resolutionTags: python language2012-07-07 17:59 125145 People read Comments (9) favorite reports Classification:Python Learning Notes (2)

Original address: HTTP://HI.BAIDU.COM/DELINX/ITEM/1789D38EAFD358D05E0EC1DF

The Python language is a language that is very sensitive to indentation, confusing to many beginners, and even a very experienced Python programmer can be caught in a trap. The most common scenario is that the mix of tab and space results in an error, or indentation is incorrect, which is not possible with the naked eye.

This error will occur at compile time indentationerror:expected an indented block indicates that indentation is required here, as long as you press space or tab (but not mix) to indent the line in the wrong line.

Often some people will question: I do not indent how or wrong, the indentation of the place will be indented, non-indentation will be wrong, such as:

If xxxxxx:

(space) xxxxx

Or

def xxxxxx:

(space) xxxxx

And also

For xxxxxx:

(space) xxxxx

A sentence with a colon the next line tends to indent, and the indentation is indented in

Python question: indentationerror:expected an indented block error resolution "Turn"

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.