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