I'm new to python and I started with classes now, I tried to start a class
but for some reason always gives error, the error changes but always gives, at the moment I am with the code this way:
class Inimigo:
def __init__(self, vida):
self.vida = vida
def ataque(self):
self.vida -= 2
inimigo1 = Inimigo()
However the error that returns is:
__init__() missing 1 required positional argument: 'vida'
I do not understand, use self.life = life no longer initializes life? And another if I want life to start as a set value how should I do?
self.vida = vida = 10
or
def __init__(self, vida = 10):
self.vida = vida