Created
April 5, 2022 14:59
-
-
Save mka142/507a4bb6f22457f147e0b160eece727e to your computer and use it in GitHub Desktop.
Check if date,number in in range of other two
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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