title: how to find min max of three varirable using only boolean and numerical comparisons, and the abs function
body: <p>i got an assignment that need to find which one is the highest, lowest, or middle</p>
  <p>assume that value of three variable x, y, z will be randomly given and we dont know the value.</p>
  <p>and we cant use min(), max()</p>
  <blockquote>
  <p>can use only numerical comparisons, boolean and abs function</p>
  </blockquote>
  <p>i spend so much times try to figure out but still stuck.</p>
  <p>this is example one of my code but this doesn't work when y is higest number because of this line</p>
  <p>&quot;range_between_middle_max = abs(max_yx - max_zx) + abs(max_zx - max_zy)&quot;</p>
  <pre><code>x = 23
  y = 14
  z = 123
  
  range_yx = abs(x - y)
  middle_yx = (x + y) / 2
  max_yx = middle_yx + (range_yx / 2)
  
  
  range_zx = abs(x - z)
  middle_zx = (x + z) / 2
  max_zx = middle_zx + (range_zx / 2)
  
  
  range_zy = abs(z - y)
  middle_zy = (z + y) / 2
  max_zy = middle_zy + (range_zy / 2)
  
  
  
  range_between_middle_max = abs(max_yx - max_zx) + abs(max_zx - max_zy)
  middle = abs(abs(max_yx - max_zx) - max_zy)
  highest = middle + range_between_middle_max
  lowest = (x+y+z) - (middle + highest)
  
  print(highest)
  print(middle)
  print(lowest)
  </code></pre>