Created
May 20, 2019 23:27
-
-
Save jennz0r/02f445b028dafd167a436a768768708e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Mammal { | |
constructor() { | |
this.neocortex = true; | |
} | |
} | |
class Cat extends Mammal { | |
constructor(name, years) { | |
super(); | |
this.name = name; | |
this.years = years; | |
} | |
eat(food) { | |
console.log('nom ' + food); | |
} | |
} | |
let fryCat = new Cat('Fry', 7); | |
fryCat.eat('steak'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Mammal(object): | |
neo_cortex = True | |
class Cat(Mammal): | |
def __init__(self, name, years): | |
self.name = name | |
self.years = years | |
def eat(food): | |
print 'nom %s' % (food) | |
fry_cat = Cat('Fry', 7) | |
fry_cat.eat('steak') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment