python中缩进错误

您所在的位置:网站首页 python整段代码缩进 python中缩进错误

python中缩进错误

2023-02-16 13:46| 来源: 网络整理| 查看: 265

在编写

python代码时,我倾向于得到很多IndentationErrors.有时,当我删除并重写该行时,错误将消失.有人可以在python中为noob提供IndentationErrors的高级解释吗?

以下是我在播放CheckIO时收到的最近一个不会消失的缩进错误示例:

def checkpass(data):

"""Checks password for >=10 char + 1 number + 1 LC letter + 1 UC letter"""

passlist = []

uclist = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L',

'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X',

'Y', 'Z']

lclist = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l',

'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x',

'y', 'z']

blah blah.. more code

这是我调用python脚本时收到的错误:

$python passcheck.py

File "passcheck.py", line 5

uclist = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L',

^

IndentationError: unindent does not match any outer indentation level



【本文地址】


今日新闻


推荐新闻


CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3