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