21 lines
566 B
Python
21 lines
566 B
Python
class Tree():
|
|
def __init__(self, typeOfTree, height, width):
|
|
self.typeOfTree = typeOfTree
|
|
self.height = height
|
|
self.width = width
|
|
|
|
def getTypeOfTree(self):
|
|
return self.typeOfTree
|
|
|
|
def getHeight(self):
|
|
return self.height
|
|
|
|
def getWidth(self):
|
|
return self.width
|
|
|
|
def grow(self, heightAdd, widthAdd):
|
|
self.height += heightAdd
|
|
self.width += widthAdd
|
|
|
|
def __str__(self):
|
|
return "Type of Tree: " + self.typeOfTree + " Height: " + str(self.height) + " Width: " + str(self.width) |