Advertisement
here2share

# mid_weight.py

Jul 20th, 2022
938
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.16 KB | None | 0 0
  1. # mid_weight.py
  2.  
  3. def mid_weight(num, a, b):
  4.     return max(min(num, max(a, b)), min(a, b))
  5. print( mid_weight(2, 7, 3) ) # 3
  6. print( mid_weight(-1, -5, 9) ) # -1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement