E:\python_projects> python .\class_static.py
File ".\class_static.py", line 35
'''test'''
^
dentationError: unindent does not match any outer indentation level
or
File ".\class_static.py", line 58
'''the last line'''
^
dentationError: unexpected indent
使用(多行注释)三个引号的注释, 一定要注意缩进要与上下文保持一致
即同层次代码是几个缩进,就几个缩进。
报上面这个错误的原因是自己在注释'''test'''前面只有三个空格导致。
同层代码是4个空格,偏偏要写8个空格,也会报错的。
对应的单行注释##, 则对缩进没有任何要求。
可能是三个引号是属于字符串的原因吧