Created
June 22, 2018 02:09
-
-
Save ichiro-arai/b7db1f586b7d66488133907344d4132d to your computer and use it in GitHub Desktop.
inclusive range function in Python (simple version)
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 irange(s, e, d=1): | |
return range(s, e + 1, d) if d > 0 else range(s, e - 1, d) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment