import random class Apple(): def __init__(self,settings): self.x = random.randint(1, settings.cell_w - 1) self.y = random.randint(1, settings.cell_h - 1) def spawn(self,settings): self.x = random.randint(1, settings.cell_w - 1) self.y = random.randint(1, settings.cell_h - 1)