diff --git a/Retos/Reto #16 - LA ESCALERA [Media]/python/ShinMugenNoKabe.py b/Retos/Reto #16 - LA ESCALERA [Media]/python/ShinMugenNoKabe.py index 456e399e83..2c8a167a7a 100644 --- a/Retos/Reto #16 - LA ESCALERA [Media]/python/ShinMugenNoKabe.py +++ b/Retos/Reto #16 - LA ESCALERA [Media]/python/ShinMugenNoKabe.py @@ -3,21 +3,21 @@ def draw_ladder(steps: int): print('__') return - left_to_right = steps > 0 + left_to_right: bool = steps > 0 - # Imprimir último escalón if left_to_right: + # Imprimir último escalón print(f"{'_' : >{(steps * 2) + 1}}") - else: - print('_') - - if left_to_right: + for i in range(steps, 0, -1): print(f"{'_|' : >{i * 2}}") else: + # Imprimir primer escalón + print('_') + for i in range(0, abs(steps), 1): print(f"{'|_' : >{((i * 2) + 3)}}") - + if __name__ == "__main__": draw_ladder(0)