I am going through the book "Problem Solving with Algorithms and Data Structures using Python"
In the chapter for Queues there is a printer simulation with the Printer class.
here is the definition of Printer class:
class Printer():
def __init__(self, ppm):
self.pagerate = ppm
self.currentTask = None
self.timeRemaining = 0
My question is that how are the instance variable not present in parameter but still defined (e.g. currentTask and timeRemaining)?
Is it a practice in Python and is there any other better way to do this?