Sichanov

walking

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