I have a code that often generates new objects and then deletes them sometimes, how would I find the amount of objects in the class at any given time?
How would I make it count up when I create an object and count down when I delete it?
class Enemy:
def __init__(self, Name, MaxHp, Hp, Def, Atk, Stat, StatCd):
e1 = Enemy("Green Slimelet", 10, 10, 0, 3, "none", 0)
e2 = Enemy("Green Slime", 25, 25, 2, 8, "none", 0)
#Here i would put the counting thing
del e1
#Count again