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