What to do with “Unexpected indent” in python?

前端 未结 17 2551
天涯浪人
天涯浪人 2020-11-22 07:46

How do I rectify the error \"unexpected indent\" in python?

17条回答
  •  轮回少年
    2020-11-22 08:02

    Turn on visible whitespace in whatever editor you are using and turn on replace tabs with spaces.

    While you can use tabs with Python mixing tabs and space usually leads to the error you are experiencing. Replacing tabs with 4 spaces is the recommended approach for writing Python code.

提交回复
热议问题