Advertisement
JOHNYTHEWINNER

Just walking

Mar 8th, 2020
178
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.37 KB | None | 0 0
  1. steps = 0
  2. sum_steps = 0
  3. while sum_steps <= 9999:
  4.     steps = input()
  5.     if steps == "Going home":
  6.         steps = int(input())
  7.         sum_steps += steps
  8.         if sum_steps >= 9999:
  9.             break
  10.         print(f"{10000 - sum_steps} more steps to reach goal.")
  11.         break
  12.     sum_steps += int(steps)
  13.  
  14. if sum_steps >= 9999:
  15.     print("Goal reached! Good job!")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement