-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Corrección Roadmap 16 + Nuevo ejercicio 17
- Loading branch information
Showing
3 changed files
with
63 additions
and
3 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import re | ||
|
||
""" | ||
Ejercicio | ||
""" | ||
|
||
|
||
def find_numbers(text: str) -> list: | ||
return re.findall(r"\d+", text) | ||
|
||
|
||
print(find_numbers("Este es el ejercicio 16 publicado 15/04/2024.")) | ||
|
||
|
||
""" | ||
Extra | ||
""" | ||
|
||
|
||
def validate_email(email: str) -> bool: | ||
return bool(re.match(r"^[\w.+-]+@[\w]+\.[a-zA-Z]+$", email)) | ||
|
||
|
||
print(validate_email("mouredev@gmail.com")) | ||
|
||
|
||
def validate_phone(phone: str) -> bool: | ||
return bool(re.match(r"^\+?[\d\s]{3,}$", phone)) | ||
|
||
|
||
print(validate_phone("+34 901 65 89 04")) | ||
|
||
|
||
def validate_url(url: str) -> bool: | ||
return bool(re.match(r"^http[s]?://(www.)?[\w]+\.[a-zA-Z]{2,}$", url)) | ||
|
||
|
||
print(validate_url("http://www.moure.dev")) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# #17 ITERACIONES | ||
> #### Dificultad: Fácil | Publicación: 22/04/24 | Corrección: 29/04/24 | ||
## Ejercicio | ||
|
||
``` | ||
/* | ||
* EJERCICIO: | ||
* Utilizando tu lenguaje, emplea 3 mecanismos diferentes para imprimir | ||
* números del 1 al 10 mediante iteración. | ||
* | ||
* DIFICULTAD EXTRA (opcional): | ||
* Escribe el mayor número de mecanismos que posea tu lenguaje | ||
* para iterar valores. ¿Eres capaz de utilizar 5? ¿Y 10? | ||
*/ | ||
``` | ||
#### Tienes toda la información extendida sobre el roadmap de retos de programación en **[retosdeprogramacion.com/roadmap](https://retosdeprogramacion.com/roadmap)**. | ||
|
||
Sigue las **[instrucciones](../../README.md)**, consulta las correcciones y aporta la tuya propia utilizando el lenguaje de programación que quieras. | ||
|
||
> Recuerda que cada semana se publica un nuevo ejercicio y se corrige el de la semana anterior en directo desde **[Twitch](https://twitch.tv/mouredev)**. Tienes el horario en la sección "eventos" del servidor de **[Discord](https://discord.gg/mouredev)**. |