Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def bouncy(n):
- n, increasing, decreasing = str(n), False, False
- for x in range(len(n)-1):
- if n[x] > n[x+1]:
- increasing = True
- if n[x] < n[x+1]:
- decreasing = True
- if increasing and decreasing:
- return True
- return False
- total = 0
- for y in range(1, 10**100):
- if bouncy(y):
- total += 1
- if total/y == 0.99:
- print(y)
- quit()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement