import random class Die(): count = 0 # class variable def __init__(self): self.faceValue = 1 # instance variable Die.count += 1 # update the class counter def __str__(self): return "face value: " + str(self.faceValue) def __int__(self): return self.faceValue def __eq__(self, otherDie): return int(self) == int(otherDie) def __add__(self, otherDie): return int(self) + int(otherDie) def roll(self): self.faceValue = random.randint(1, 6)