Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import tracemalloc
- # Inicio de la traza de memoria:
- tracemalloc.start()
- def factorial(numero):
- """
- Calcula el factorial de un número de forma recursiva.
- """
- if numero == 1:
- return 1
- else:
- return numero * factorial(numero - 1)
- print(factorial(19))
- snapshot = tracemalloc.take_snapshot()
- estadisticas = snapshot.statistics('lineno')
- for estadistica in estadisticas:
- print(estadistica)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement