-1

I was looking for the same thing https://stackoverflow.com/a/72842963/18334455 but my problem is how to make a condition so that the matched pair should be within 10 years of age-old and within 10 height difference, I need my code to find the matched randomly matched pair that achieve both conditions. Can anybody help me with this? Thanks

Christoph Rackwitz
  • 11,317
  • 4
  • 27
  • 36
Mrmr
  • 35
  • 4

1 Answers1

0

Pretty straight forward with an if condition, it all depends on your data types, but it could in theory look like this:

if abs(age1 - age2) < 10 and abs(height1 - height2) < 10:
    print('Yay you are almost same height and age, so it must be a match!')

else: print('No match, you are way too different')
Anynamer
  • 334
  • 1
  • 6