Advertisement
veronikaaa86

04. Walking

Jun 5th, 2022
304
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. input_line = input()
  2. # Going home 1000
  3. sum_steps = 0
  4. while input_line != "Going home":
  5. steps = int(input_line)
  6. sum_steps += steps
  7.  
  8. if sum_steps >= 10000:
  9. break
  10.  
  11. input_line = input()
  12.  
  13. if input_line == "Going home":
  14. steps_home = int(input())
  15. sum_steps += steps_home
  16.  
  17. diff = abs(10000 - sum_steps)
  18. if sum_steps >= 10000:
  19. print("Goal reached! Good job!")
  20. print(f"{diff} steps over the goal!")
  21. else:
  22. print(f"{diff} more steps to reach goal.")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement