pythonの本を買って、その通りに学習を進めている途中です
ですが、教科書に載っていたプログラムを作り、その通りに起動したはずなのですがうまくいきませんでした
以下にそのプログラムとエラーを示します
コード
class Michael:
def init(self,amax):
self.max = amax
self.count = 0
def teach(self): if self.count < self.max: print("more over!") else: print("Yeah,good!") self.count += 1
実行
oni = Michael(5)
Traceback (most recent call last):
File "<pyshell#13>", line 1, in <module>
oni = Michael(5)
TypeError: object() takes no parameters
回答1件
あなたの回答
tips
プレビュー