Python积累三:object() take no object!

A,报错:object() take no object!

根因:代码书写级错误!!!!!

两个原因:

1. __init__ 左右都是2个下划线,这里自己没掉进去!

2.init写成int,不是int,太想当然,成功掉坑里!!!!!!

B,报错:IndentationError: expected an indented block

是脚本缩进的问题,检查脚本缩进是否有空格和tab混用的情况或者是缩进明显不对的情况。

C,报错:unindented does not match any outer indentation level

根因:Tab和空格会报错

检查方法:ctrl+A选中所有代码,可看到哪些是空格,哪些是Tab。

如果是....表示空格;

       是——表示Tab。

原文地址:https://www.cnblogs.com/dLarger/p/10509911.html