bl00dt3ars

04. Walking

Nov 1st, 2021 (edited)
538
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.33 KB | None | 0 0
  1. steps = 0
  2.  
  3. while steps < 10000:
  4.     command = input()
  5.     if command == 'Going home':
  6.         steps += int(input())
  7.         break
  8.     else:
  9.         steps += int(command)
  10.  
  11. if steps < 10000:
  12.     print(f'{10000-steps} more steps to reach goal.')
  13. else:
  14.     print(f'Goal reached! Good job!\n{steps-10000} steps over the goal!')
Add Comment
Please, Sign In to add comment