Skip to content

Commit

Permalink
Merge pull request #4655 from marcoatrs/main
Browse files Browse the repository at this point in the history
Reto #16 - Python
  • Loading branch information
kontroldev authored Aug 17, 2023
2 parents 05e06b9 + 6f9e4eb commit 8001949
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 8001949

Please sign in to comment.