跟着zxw老师视频学习,写这个程序时理解什么意思了,但是死活就是报错,仔细看了代码并没有写错,百度一下才发现是因为把–init–写成了-init-,还有一种错误是把–init–写成–int–也会报这个错,怕自己记不住,写下来比较靠谱,双横杠和单横杠区别开,init不要写成int
这是正确的写法,错误的写法是下面这种
相关文章
- 错误:takes from 1 to 2 positional arguments but 3 were given
- Python~TypeError: array takes from 1 to 2 positional arguments but 3 were given
- python执行时产生了typeerror错误?
- Python 错误 TypeError 解析,实际错误实例详解 (一)
- Python 读写文件 中文乱码 错误TypeError: write argument must be str, not bytes+
- python 错误分析 TypeError: can only concatenate str (not “float“) to str
- Python: TypeError: XXX takes exactly 1 argument (2 given)
- Python 中的object takes no parameters错误
- TypeError: __init__() takes from 1 to 2 positional arguments but 3 were given
- Python遇到的代码错误:TypeError: __init__() missing 1 required positional argument: ‘priviledges‘