diff --git "a/Retos/Reto #0 - EL FAMOSO FIZZ BUZZ [F\303\241cil]/python/PatriciaOM.py" "b/Retos/Reto #0 - EL FAMOSO FIZZ BUZZ [F\303\241cil]/python/PatriciaOM.py" new file mode 100644 index 0000000000..799d647f8d --- /dev/null +++ "b/Retos/Reto #0 - EL FAMOSO FIZZ BUZZ [F\303\241cil]/python/PatriciaOM.py" @@ -0,0 +1,20 @@ +""" +Escribe un programa que muestre por consola (con un print) los +números de 1 a 100 (ambos incluidos y con un salto de línea entre +cada impresión), sustituyendo los siguientes: +Múltiplos de 3 por la palabra "fizz". +Múltiplos de 5 por la palabra "buzz". +Múltiplos de 3 y de 5 a la vez por la palabra "fizzbuzz". +""" +def reto_1(): + for number in range (1, 101): + if number%3 == 0 and number%5 == 0: + print("fizzbuzz") + elif number%3 == 0: + print("fizz") + elif number%5 == 0: + print("buzz") + else: + print(number) + +reto_1() diff --git "a/Retos/Reto #1 - EL LENGUAJE HACKER [F\303\241cil]/python/PatriciaOM.py" "b/Retos/Reto #1 - EL LENGUAJE HACKER [F\303\241cil]/python/PatriciaOM.py" new file mode 100644 index 0000000000..884c7be27b --- /dev/null +++ "b/Retos/Reto #1 - EL LENGUAJE HACKER [F\303\241cil]/python/PatriciaOM.py" @@ -0,0 +1,28 @@ +""" +Escribe un programa que reciba un texto y transforme lenguaje natural a +"lenguaje hacker" (conocido realmente como "leet" o "1337"). Este lenguaje +se caracteriza por sustituir caracteres alfanuméricos. +- Utiliza esta tabla (https://www.gamehouse.com/blog/leet-speak-cheat-sheet) +con el alfabeto y los números en "leet". +(Usa la primera opción de cada transformación. Por ejemplo "4" para la "a") +""" + +def lenguaje_hacker(text): + new_text = "" + list_indexes = [] + alphabet_numbers = ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m" + ,"n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z" + ,"1", "2", "3", "4", "5", "6", "7", "8", "9", "0", " ", ".", ","] + leet_alphabet_numbers = ["4", "I3", "[", ")", "3", "|=", "&", "#", "1", ",_|", ">|", "1", + "/\/\\", "^/", "0", "|*", "(_,)", "I2", "5", "7", "(_)", "\/", + "\/\/", "><", "j", "2", "L", "R", "E", "A", "S", "b", "T", "B", + "g", "o", " ",".", ","] + for letter in text: + for character in alphabet_numbers: + if letter.lower() == character: + list_indexes.append(alphabet_numbers.index(character)) + for index in list_indexes: + new_text = new_text + leet_alphabet_numbers[index] + print(new_text) + +lenguaje_hacker("Hola, me llamo Patricia.") \ No newline at end of file