RosettaCodeData/Task/Stair-climbing-puzzle/Python/stair-climbing-puzzle-1.py
2023-07-01 13:44:08 -04:00

9 lines
241 B
Python

def step_up1():
"""Straightforward implementation: keep track of how many level we
need to ascend, and stop when this count is zero."""
deficit = 1
while deficit > 0:
if step():
deficit -= 1
else:
deficit += 1