Last active
August 29, 2016 03:37
-
-
Save aduartem/6493f0a8ebd0f53924ea to your computer and use it in GitHub Desktop.
Python - Herencia múltiple
This file contains hidden or 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
#!/usr/bin/python | |
"""Ejemplo extraido desde el libro Python para todos de Raul Gonzalez Duque""" | |
class Terrestre: | |
def desplazar(self): | |
print "El animal anda" | |
class Acuatico: | |
def desplazar(self): | |
print "El animal nada" | |
class Cocodrilo(Terrestre, Acuatico): | |
pass | |
c = Cocodrilo() | |
c.desplazar() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment