Advertisement
bl00dt3ars

04. Walking

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