Skip to content

Instantly share code, notes, and snippets.

@TZubiri
Last active July 10, 2019 23:52
Show Gist options
  • Save TZubiri/929b015b5c3eddf2c2495fdfb457ce7b to your computer and use it in GitHub Desktop.
Save TZubiri/929b015b5c3eddf2c2495fdfb457ce7b to your computer and use it in GitHub Desktop.
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