Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Desafíos incrementales para programar un ahorcado
#nivel 1
def contiene_letra(aguja,pajar):
pass
assert( contiene_letra("o","avion") == True)
assert( contiene_letra("o","dinosaurio") == True)
assert( contiene_letra("g","dinosaurio") == False)
assert( contiene_letra("g","a") == False)
assert( contiene_letra("g","g") == True)
#nivel 2
def posicion_de_letra(aguja,pajar):
pass
assert( posicion_de_letra("o","avion") == 4)
assert( posicion_de_letra("o","dinosaurio") == 4)
#Hay 2 o en este caso como lo solucionás! Podés usar una lista de numeros, pero todo debería devolver una lista
#nivel x
def posicion_de_letras(aguja,pajar):
pass
assert( posicion_de_letra("o","avion") == [4])
assert( posicion_de_letra("o","dinosaurio") == [4,10])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment