if end1 <= val <= end2 or end2 <= val <= end1:
return True
else:
return False
等于
return end1 <= val <= end2 or end2 <= val <= end1
if end1 <= val <= end2 or end2 <= val <= end1:
return True
else:
return False
等于
return end1 <= val <= end2 or end2 <= val <= end1