Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- total_steps = 10000
- made_steps = 0
- while True:
- steps = input()
- if steps.isnumeric():
- made_steps += int(steps)
- if made_steps >= total_steps:
- break
- else:
- made_steps += int(input())
- break
- if made_steps >= total_steps:
- print('Goal reached! Good job!')
- print(f'{abs(total_steps - made_steps)} steps over the goal.')
- else:
- print(f'{total_steps - made_steps} more steps to reach goal.')
- # total_steps = 0
- # command = ''
- #
- # while total_steps < 10000 and command != 'Going home':
- # command = input()
- # if command.isnumeric():
- # total_steps += int(command)
- # if total_steps >= 10000:
- # print('Goal reached! Good job!')
- # if total_steps > 10000:
- # print(f'{total_steps - 10000} steps over the goal!')
- # if command == 'Going home':
- # steps_home = int(input())
- # if total_steps + steps_home >= 10000:
- # print('Goal reached! Good job!')
- # if total_steps + steps_home > 10000:
- # print(f'{abs(10000 - total_steps - steps_home)} steps over the goal!')
- # else:
- # print(f'{abs(10000 - total_steps - steps_home)} more steps to reach goal.')
- # steps_goal = 10000
- # extra_steps = 0
- # steps_count = 0
- # while steps_count <= 10000:
- # command = input()
- # if command == "Going home":
- # command = input()
- # more_steps = int(command)
- # steps_count += more_steps
- # break
- # steps = int(command)
- # steps_count += steps
- # if steps_count >= steps_goal:
- # extra_steps = steps_count - steps_goal
- # print("Goal reached! Good job!")
- # print(f"{extra_steps} steps over the goal!")
- # else:
- # print(f"{steps_goal - steps_count} more steps to reach goal.")
- # total_steps = 0
- # command = ''
- #
- # while total_steps < 10000 and command != 'Going home':
- # steps = int(input())
- # total_steps += steps
- # if total_steps >= 10000:
- # print('Goal reached! Good job!')
- # if total_steps > 10000:
- # print(f'{total_steps - 10000} steps over the goal!')
- # if command == 'Going home':
- # steps_home = int(input())
- # if total_steps + steps_home >= 10000:
- # print('Goal reached! Good job!')
- # if total_steps > 10000:
- # print(f'{total_steps - 10000} steps over the goal!')
- # else:
- # print(f'{10000 - total_steps - steps_home} more steps to reach goal.')
- #
- #
- # # завършеният вариант с насоки от Krum Manasiev
- #
- #
- # total_steps = 0
- # command = ''
- #
- # while total_steps < 10000 and command != 'Going home':
- # command = input()
- # if command.isnumeric():
- # total_steps += int(command)
- # if total_steps >= 10000:
- # print('Goal reached! Good job!')
- # if total_steps > 10000:
- # print(f'{total_steps - 10000} steps over the goal!')
- # if command == 'Going home':
- # steps_home = int(input())
- # if total_steps + steps_home >= 10000:
- # print('Goal reached! Good job!')
- # if total_steps + steps_home > 10000:
- # print(f'{abs(10000 - total_steps - steps_home)} steps over the goal!')
- # else:
- # print(f'{abs(10000 - total_steps - steps_home)} more steps to reach goal.')
Add Comment
Please, Sign In to add comment