Advertisement
aneliabogeva

Walking

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