Advertisement
eNeRGy90

walking

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