Guest User

Untitled

a guest
Feb 15th, 2020
220
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.39 KB | None | 0 0
  1. GOAL = 10000
  2.  
  3. steps = 0
  4. goal_reached = False
  5.  
  6. while steps < GOAL:
  7.     command = input()
  8.  
  9.     if command == 'Going home':
  10.         command = input()
  11.         steps += int(command)
  12.         break
  13.  
  14.     steps += int(command)
  15.  
  16. if steps >= GOAL:
  17.     goal_reached = True
  18.  
  19. if goal_reached:
  20.     print(f'Goal reached! Good job!')
  21. else:
  22.     print(f'{GOAL - steps} more steps to reach goal.')
Advertisement
Add Comment
Please, Sign In to add comment