doubledare704

Untitled

Mar 16th, 2021 (edited)
311
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.34 KB | None | 0 0
  1. @timeit
  2. def bouncing_ball4(h, bounce, window):
  3.     if h != 0 and 0 < bounce < 1 and window < h:
  4.         count = 1
  5.         current = h * bounce
  6.         while current > window:
  7.             current *= bounce
  8.             count += 2
  9.         return count
  10.     else:
  11.         return -1
  12.  
  13.  
  14. print(bouncing_ball4(9223372036854775807, 0.999999, 1))
Add Comment
Please, Sign In to add comment