Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #команда -> Going home или стъпки(текст)
- #стоп -> count_steps >= 10000
- #продължавам -> count_steps < 10000
- count_steps = 0
- while count_steps < 10000:
- command = input()
- #1. Going home
- if command == 'Going home':
- steps_to_home = int(input())
- count_steps += steps_to_home
- break
- # 2. стъпки под формата на текст
- else:
- walked_steps = int(command)
- count_steps += walked_steps
- #спряли вървенето
- if count_steps >= 10000:
- #постига целта
- print('Goal reached! Good job!')
- else:
- # не си постига целта
- print(f'{10000 - count_steps} more steps to reach goal.')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement