Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- goal = int(input())
- starting_goal = goal - 30
- failed_attempts = 0
- counter = 0
- while starting_goal <= goal:
- current_jump = int(input())
- if current_jump > starting_goal:
- starting_goal += 5
- failed_attempts = 0
- else:
- failed_attempts += 1
- counter += 1
- if failed_attempts == 3:
- break
- if failed_attempts == 3:
- print(f'Tihomir failed at {starting_goal}cm after {counter} jumps.')
- else:
- print(f'Tihomir succeeded, he jumped over {goal}cm after {counter} jumps.')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement