Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def interval(start, stop =None, step = 1 ):
- 'Imitates range() for step >0 '
- if stop is None:
- start, stop = 0, start #since start is already 0, why isn't stop as well?
- print start,stop , step
- result = []
- i = start
- while i< stop:
- result.append(i)
- i+=step
- return result
- start, stop = 0, start
- start = 0
- stop = start
- a = 1
- a, b = 0, a
- import dis
- dis.dis(compile("a = 1; a, b = 0, a", "<string>", "exec"))
- 6 LOAD_CONST 1 (0)
- 9 LOAD_NAME 0 (a)
- 13 STORE_NAME 0 (a)
- 16 STORE_NAME 1 (b)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement