Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # mid_weight.py
- def mid_weight(num, a, b):
- return max(min(num, max(a, b)), min(a, b))
- print( mid_weight(2, 7, 3) ) # 3
- print( mid_weight(-1, -5, 9) ) # -1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement