From a4b6c4c3553d20195219bc70bd011d306fbe3368 Mon Sep 17 00:00:00 2001 From: "J.ArturoDev" <91026869+ARTUROCRACKEN@users.noreply.github.com> Date: Sun, 22 Dec 2024 18:38:23 -0500 Subject: [PATCH] Reto #16 Mi solucion en python. --- .../python/ARTUROCRACKEN.py | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 Retos/Reto #16 - LA ESCALERA [Media]/python/ARTUROCRACKEN.py diff --git a/Retos/Reto #16 - LA ESCALERA [Media]/python/ARTUROCRACKEN.py b/Retos/Reto #16 - LA ESCALERA [Media]/python/ARTUROCRACKEN.py new file mode 100644 index 0000000000..3af8297dc6 --- /dev/null +++ b/Retos/Reto #16 - LA ESCALERA [Media]/python/ARTUROCRACKEN.py @@ -0,0 +1,25 @@ +# funcion para printear escalera + +def escalera(n): + + if n > 0: + for i in range(0, n+1): + if i != 0: + print(' '*(n-i) + '_|') + else: + print(' '*(n-i) + '_') + elif n < 0: + for i in range(0, -n+1): + if i != 0: + print(' '*((i*2)-1) + '|_') + else: + print('_') + else: + print('__') + +print('Ascendente:') +escalera(4) +print('\nDescendente:') +escalera(-4) +print('\n0:') +escalera(0)