anton_d

04.walking

Jan 24th, 2022 (edited)
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 3.38 KB | None | 0 0
  1. total_steps = 10000
  2. made_steps = 0
  3.  
  4. while True:
  5.     steps = input()
  6.     if steps.isnumeric():
  7.         made_steps += int(steps)
  8.         if made_steps >= total_steps:
  9.             break
  10.     else:
  11.         made_steps += int(input())
  12.         break
  13.  
  14. if made_steps >= total_steps:
  15.     print('Goal reached! Good job!')
  16.     print(f'{abs(total_steps - made_steps)} steps over the goal.')
  17. else:
  18.     print(f'{total_steps - made_steps} more steps to reach goal.')
  19.  
  20. # total_steps = 0
  21. # command = ''
  22. #
  23. # while total_steps < 10000 and command != 'Going home':
  24. #     command = input()
  25. #     if command.isnumeric():
  26. #         total_steps += int(command)
  27. #     if total_steps >= 10000:
  28. #         print('Goal reached! Good job!')
  29. #         if total_steps > 10000:
  30. #             print(f'{total_steps - 10000} steps over the goal!')
  31. #     if command == 'Going home':
  32. #         steps_home = int(input())
  33. #         if total_steps + steps_home >= 10000:
  34. #             print('Goal reached! Good job!')
  35. #             if total_steps + steps_home > 10000:
  36. #                 print(f'{abs(10000 - total_steps - steps_home)} steps over the goal!')
  37. #         else:
  38. #             print(f'{abs(10000 - total_steps - steps_home)} more steps to reach goal.')
  39.  
  40.  
  41.  
  42. # steps_goal = 10000
  43. # extra_steps = 0
  44. # steps_count = 0
  45. # while steps_count <= 10000:
  46. #     command = input()
  47. #     if command == "Going home":
  48. #         command = input()
  49. #         more_steps = int(command)
  50. #         steps_count += more_steps
  51. #         break
  52. #     steps = int(command)
  53. #     steps_count += steps
  54. # if steps_count >= steps_goal:
  55. #     extra_steps = steps_count - steps_goal
  56. #     print("Goal reached! Good job!")
  57. #     print(f"{extra_steps} steps over the goal!")
  58. # else:
  59. #     print(f"{steps_goal - steps_count} more steps to reach goal.")
  60.  
  61. # total_steps = 0
  62. # command = ''
  63. #
  64. # while total_steps < 10000 and command != 'Going home':
  65. #     steps = int(input())
  66. #     total_steps += steps
  67. #     if total_steps >= 10000:
  68. #         print('Goal reached! Good job!')
  69. #         if total_steps > 10000:
  70. #             print(f'{total_steps - 10000} steps over the goal!')
  71. #     if command == 'Going home':
  72. #         steps_home = int(input())
  73. #         if total_steps + steps_home >= 10000:
  74. #             print('Goal reached! Good job!')
  75. #             if total_steps > 10000:
  76. #                 print(f'{total_steps - 10000} steps over the goal!')
  77. #         else:
  78. #             print(f'{10000 - total_steps - steps_home} more steps to reach goal.')
  79. #
  80. #
  81. # # завършеният вариант с насоки от Krum Manasiev
  82. #
  83. #
  84. # total_steps = 0
  85. # command = ''
  86. #
  87. # while total_steps < 10000 and command != 'Going home':
  88. #     command = input()
  89. #     if command.isnumeric():
  90. #         total_steps += int(command)
  91. #     if total_steps >= 10000:
  92. #         print('Goal reached! Good job!')
  93. #         if total_steps > 10000:
  94. #             print(f'{total_steps - 10000} steps over the goal!')
  95. #     if command == 'Going home':
  96. #         steps_home = int(input())
  97. #         if total_steps + steps_home >= 10000:
  98. #             print('Goal reached! Good job!')
  99. #             if total_steps + steps_home > 10000:
  100. #                 print(f'{abs(10000 - total_steps - steps_home)} steps over the goal!')
  101. #         else:
  102. #             print(f'{abs(10000 - total_steps - steps_home)} more steps to reach goal.')
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
Add Comment
Please, Sign In to add comment