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
#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) |
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
import sys | |
import random | |
palabras = ['lentes', 'disquete', 'profilactico', 'choque', 'fichero', 'base', 'presidente', 'tortilla', 'semilla', 'lavarse'] | |
#cuenta cuantas palabras hay en la lista | |
cantidad = len(palabras) | |
#toma una palabra al azar por medio de un número de 0 - 9 | |
n = random.randint(0, cantidad - 1) | |
#guarda la palabra random de la lista que estaba asignada por un número anteriormente | |
palabra = palabras[n] |