import random class Weapon: def __init__(self, name): self.name = name self.bonus = 2 def randomize_bonus(self, max_bonus): self.bonus = random.randint(1, max_bonus)