Created
June 6, 2014 04:55
-
-
Save colltoaction/1f238180cf1bd5c678d2 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
def replicar(lista, repeticiones): | |
if len(lista) <= 1: | |
return lista * repeticiones | |
mitad = len(lista) / 2 | |
return replicar(lista[:mitad], repeticiones) + replicar(lista[mitad:], repeticiones) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment