Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from itertools import product
- def frange(x, y, jump):
- while x < y:
- yield x
- x += jump
- x1 = frange(0, 10, 0.1)
- x2 = frange(0, 10, 0.1)
- x3 = frange(0, 10, 0.1)
- x4 = frange(0, 10, 0.1)
- quadriplets = product(x1, x2, x3, x4)
- for a, b, c, d in quadriplets:
- if 2 - abs(a * b) <= 0.01 and \
- 3 - abs(a * c) <= 0.01 and \
- 4 - abs(a * d) <= 0.01 and \
- 5 - abs(b * c) <= 0.01 and \
- 6 - abs(b * d) <= 0.01:
- print a, b, c, d
- break
Add Comment
Please, Sign In to add comment