Skip to content

Commit

Permalink
Reto mouredev#16 - Python
Browse files Browse the repository at this point in the history
  • Loading branch information
marcoatrs committed Aug 16, 2023
1 parent 78bdbcb commit 6f9e4eb
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions Retos/Reto #16 - LA ESCALERA [Media]/python/marcoatrs.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
def dibujar_escalera(escalones: int):
if escalones == 0:
print("__")
return

if escalones > 0:
for step in range(escalones, 0, -1):
space = " " * (2 * step)
if step == (escalones):
print(f"{space}_")
print(f"{space[:-2]}_|")

else:
for step in range(abs(escalones)):
space = " " * (2 * step + 1)
if step == 0:
print(f"_")
print(f"{space}|_")


dibujar_escalera(0)

0 comments on commit 6f9e4eb

Please sign in to comment.