Skip to content

Instantly share code, notes, and snippets.

@mka142
Created April 5, 2022 14:59
Show Gist options
  • Save mka142/507a4bb6f22457f147e0b160eece727e to your computer and use it in GitHub Desktop.
Save mka142/507a4bb6f22457f147e0b160eece727e to your computer and use it in GitHub Desktop.
Check if date,number in in range of other two
def in_range(start, end, x):
"""Return true if x is in the range [start, end]"""
if start <= end:
return start <= x <= end
else:
return start <= x or x <= end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment