Skip to content

Instantly share code, notes, and snippets.

@rdcoder33
Last active December 26, 2018 11:32
Show Gist options
  • Save rdcoder33/7e1376d097a6462e7d18f9bb90066742 to your computer and use it in GitHub Desktop.
Save rdcoder33/7e1376d097a6462e7d18f9bb90066742 to your computer and use it in GitHub Desktop.
class Robot:
def __init__(self, name, model_no, creator):
self.name = name
self.model_no = model_no
self.creator = creator
def walk(self):
return 'I am walking using my wheels'
def charge(self):
return 'I am charging'
class Dog:
def __init__(self, height, weight, species=None):
self.species = species
self.height = height
self.weight = weight
def eat(self):
return "I'm eating"
def sleep(self):
return "I'm sleeping"
def walk(self):
return "I'm walking with my legs"
class RoboDog(Robot, Dog):
def __init__(self, name, model_no, creator, height, weight):
Robot.__init__(self, name, model_no, creator)
Dog.__init__(self, height, weight)
Pika = RoboDog('Pika', 'rd-t1', 'Robo-Labs', '2', '5')
print(Pika.walk())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment