Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Mi solucion en python.
  • Loading branch information
ARTUROCRACKEN authored Dec 22, 2024
1 parent 96e39d7 commit a4b6c4c
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions Retos/Reto #16 - LA ESCALERA [Media]/python/ARTUROCRACKEN.py
Original file line number Diff line number Diff line change
@@ -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)

0 comments on commit a4b6c4c

Please sign in to comment.