Skip to content

Instantly share code, notes, and snippets.

@ichiro-arai
Created June 22, 2018 02:09
Show Gist options
  • Save ichiro-arai/b7db1f586b7d66488133907344d4132d to your computer and use it in GitHub Desktop.
Save ichiro-arai/b7db1f586b7d66488133907344d4132d to your computer and use it in GitHub Desktop.
inclusive range function in Python (simple version)
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