On Apr 27, 10:50 pm, Paul Rubin <http://phr...@nospam.invalid> wrote:
> William Clifford <mr.william.cliff...@gmail.com> writes:
> > def enrag(start, stop=None, step=1):
> >     '''Yield a range of numbers from inside-out, evens on left.'''
>
>     >>> list(enrag(10))
>     [8, 6, 4, 2, 0, 1, 3, 5, 7, 9]    
>
> ok, but:
>
>     >>> list(enrag(10,20))
>     [18, 16, 14, 12, 10, 1, 3, 5, 7, 9, 11, 13, 15, 17, 19]
>
> is that really what you wanted?
>
>     >>> list(enrag(20))
>     [18, 16, 14, 12, 10, 8, 6, 4, 2, 0, 1, 3, 5, 7, 9, 11, 13, 15, 17, 19]

Uh. No. Thank you. This was an easy fix. But now I've found other
problems with stepping I was trying to get it to do too. Yuck.

--
William Clifford
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to