Skip to content

Instantly share code, notes, and snippets.

@jennz0r
Created May 20, 2019 23:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jennz0r/02f445b028dafd167a436a768768708e to your computer and use it in GitHub Desktop.
Save jennz0r/02f445b028dafd167a436a768768708e to your computer and use it in GitHub Desktop.
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');
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