diff --git "a/Retos/Reto #28 - EXPRESI\303\223N MATEM\303\201TICA [Media]/python/majinka10.py" "b/Retos/Reto #28 - EXPRESI\303\223N MATEM\303\201TICA [Media]/python/majinka10.py" new file mode 100644 index 0000000000..d68431abe2 --- /dev/null +++ "b/Retos/Reto #28 - EXPRESI\303\223N MATEM\303\201TICA [Media]/python/majinka10.py" @@ -0,0 +1,15 @@ +import re + +patron = re.compile(r'-?\d+(\.\d+)?\s*[+\-*/%]\s*-?\d+(\.\d+)?(?:\s*[+\-*/%]\s*-?\d+(\.\d+)?)?') + +def evaluador(expresion:str): + match = patron.search(expresion) + if match: + return True + else: + return False + + +print(evaluador('5 + 6 / 7 - 4')) +print(evaluador('5 a 3')) +print(evaluador('3.2 % 3 + 5 - 3 / 2')) \ No newline at end of file diff --git "a/Retos/Reto #29 - EL CAR\303\201CTER INFILTRADO [F\303\241cil]/python/majinka10.py" "b/Retos/Reto #29 - EL CAR\303\201CTER INFILTRADO [F\303\241cil]/python/majinka10.py" new file mode 100644 index 0000000000..37c4a3f113 --- /dev/null +++ "b/Retos/Reto #29 - EL CAR\303\201CTER INFILTRADO [F\303\241cil]/python/majinka10.py" @@ -0,0 +1,13 @@ +def infiltrado(texto1:str,texto2:str): + infiltrados=[] + if len(texto1) == len(texto2): + for tupla in zip(texto1,texto2): + if tupla[0] != tupla[1]: + infiltrados.append(tupla[0]) + else: + return print('Los textos no tienen el mismo tamaño') + return print(infiltrados) + +infiltrado('abc','abdc') +infiltrado('Me llamo mouredev','Me llemo mouredov') +infiltrado('Me llamo.Brais Moure','Me llamo brais moure') \ No newline at end of file diff --git a/Retos/Reto #30 - EL TECLADO T9 [Media]/python/majinka10.py b/Retos/Reto #30 - EL TECLADO T9 [Media]/python/majinka10.py new file mode 100644 index 0000000000..a7459de500 --- /dev/null +++ b/Retos/Reto #30 - EL TECLADO T9 [Media]/python/majinka10.py @@ -0,0 +1,13 @@ +t9_dict={'1':',','11':'.','111':'?','1111':'!','2':'A','22':'B','222':'C','3':'D','33':'E','333':'F','4':'G','44':'H','444':'I','5':'J','55':'K','555':'L','6':'M','66':'N','666':'O','7':'P','77':'Q','777':'R','7777':'S','8':'T','88':'U','888':'V','9':'W','99':'X','999':'Y','9999':'Z','0':' '} + +def convert_to_t9(texto:str): + texto=texto.split('-') + text_t9='' + for bloque in texto: + if bloque in t9_dict: + text_t9+=t9_dict[bloque] + else: + return print('Bloque de números no encontrado') + return print(text_t9) + +convert_to_t9('44-666-555-2-0-555-444-66-3-88-777-2-1111') \ No newline at end of file