Created
April 10, 2015 07:50
-
-
Save pigletfly/64ffb520517ae1dd57ee to your computer and use it in GitHub Desktop.
This file contains 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 range(start, stop=None, step=None): | |
result = [] | |
s = 1 | |
if step is not None: | |
s = step | |
if stop is not None: | |
while True: | |
if start < stop: | |
result.append(start) | |
start += s | |
else: | |
break | |
else: | |
stop, start = start, 0 | |
while True: | |
if start < stop: | |
result.append(start) | |
start += s | |
else: | |
break | |
return result |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment