the-honk/school/a-level/y13 2021-2023/OOP/Pest.py

15 lines
307 B
Python
Raw Normal View History

2024-10-09 17:02:47 +00:00
class Pest:
def __init__(self, legs, noise):
self.__legs = legs
self.__noise = noise
def getLegs(self):
return self.__legs
def getNoise(self):
return self.__noise
dog = Pest(4, 'woof')
roach = Pest(6, 'click click click')
print(roach.getNoise())