] 类型 indentationerror: expected an indented block缩进错误:检查代码的缩进是否正确 indentation [ˌɪndenˈteɪʃn] 行首缩进 expected [ɪkˈspektɪd] 检查 indented [ɪnˈdentɪd] 缩进的 block [blɒk] 块 valueerror: substring not found值错误:输入的 python:IndentationError:exp...
定义函数时,使用三引号注释提示错误:IndentationError:expected an indented block #juzicode.com/vx:桔子code deffuc(): ''' 定义一个函数 ''' print('桔子code') print('juzicode.com') returnNone #调用func函数 fuc() 可能原因: 1、三引号注释存在缩进错误。 解决方法: 1、 三引号注释应该当成占位符和d...
对。关于提示缩进错误,偿试检查一下缩进的控制 检查是否有tab,有的开发环境下tab定义是不同的。python的最实践是,用4个空格。检查是否有中文空格,这是常间的问题。检查是否有其它的非可见字符。
运行代码时提示“SyntaxError: expected an indented block”, 说明缩进有问题,请检查缩进后,调整正确即可。 Python代码对缩进的要求非常严格,相同层次的代码必须具有同样的缩进量。