, class Dog: , # Class attributes , species = DQCanis familiarisDQ , def __init__(self, name, age): , # instance attributes , self.name = name , self.age = age , , # Instance method , def description(self): , return print(self.name + DQ is DQ + str(self.age) + DQ years oldDQ) , ,
, # the file name minus the extension -- importing the class Dog , from DogClass import Dog , , # creating an instance of the Dog class , buddy = Dog(DQBuddyLoveDQ,14) , , print(DQSpecies: DQ + buddy.species) , print(DQName: DQ + buddy.name + DQ\nAge: DQ + str(buddy.age)) , print(buddy.description()) ,