Functions and Methods
Methods are functions defined as a part of a class and invoked by instances of that class
class Human:
life = 5
revives = 3
def revive(self):
if self.life >= 0:
print("Player has life, they do not need to be revived!")
return
elif self.revives <= 0:
print("This human is out of first aid, sorry :(")
return
self.revives = self.revives - 1
self.health = 10
human1 = Player()
human.revive()
Methods can reference the object instance they're being invoked from.
Methods describe the behavior of a class/object in OOP code
objects = classes objects in OOP can be created, destroyed and manipulated in isolation from one another