forked from mouredev/roadmap-retos-programacion
-
Notifications
You must be signed in to change notification settings - Fork 0
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 24 + Nuevo ejercicio 25
- Loading branch information
Showing
4 changed files
with
95 additions
and
4 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
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,64 @@ | ||
""" | ||
Ejercicio | ||
""" | ||
|
||
|
||
def print_call(function): | ||
def print_function(): | ||
print(f"La función '{function.__name__}' ha sido llamada.") | ||
return function | ||
return print_function | ||
|
||
|
||
@print_call | ||
def example_function(): | ||
pass | ||
|
||
|
||
@print_call | ||
def example_function_2(): | ||
pass | ||
|
||
|
||
@print_call | ||
def example_function_3(): | ||
pass | ||
|
||
|
||
example_function() | ||
example_function_2() | ||
example_function_3() | ||
|
||
""" | ||
Extra | ||
""" | ||
|
||
|
||
def call_counter(function): | ||
def counter_function(): | ||
counter_function.call_count += 1 | ||
print( | ||
f"La función '{function.__name__} se ha llamado {counter_function.call_count}' veces.") | ||
return function | ||
|
||
counter_function.call_count = 0 | ||
return counter_function | ||
|
||
|
||
@call_counter | ||
def example_function_4(): | ||
pass | ||
|
||
|
||
@call_counter | ||
def example_function_5(): | ||
pass | ||
|
||
|
||
example_function_4() | ||
example_function_4() | ||
example_function_4() | ||
example_function_4() | ||
example_function_5() | ||
example_function_4() | ||
example_function_5() |
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,26 @@ | ||
# #25 LOGS | ||
> #### Dificultad: Fácil | Publicación: 17/06/24 | Corrección: 24/06/24 | ||
## Ejercicio | ||
|
||
``` | ||
/* | ||
* EJERCICIO: | ||
* Explora el concepto de "logging" en tu lenguaje. Configúralo y muestra | ||
* un ejemplo con cada nivel de "severidad" disponible. | ||
* | ||
* DIFICULTAD EXTRA (opcional): | ||
* Crea un programa ficticio de gestión de tareas que permita añadir, eliminar | ||
* y listar dichas tareas. | ||
* - Añadir: recibe nombre y descripción. | ||
* - Eliminar: por nombre de la tarea. | ||
* Implementa diferentes mensajes de log que muestren información según la | ||
* tarea ejecutada (a tu elección). | ||
* Utiliza el log para visualizar el tiempo de ejecución de cada tarea. | ||
*/ | ||
``` | ||
#### 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)**. |