On May 8, 5:55 pm, John Yeung <gallium.arsen...@gmail.com> wrote: > On May 8, 3:03 pm,walterbyrd<walterb...@iname.com> wrote: > > > This works, but it seems like there should be a better way. > > > -------------- > > week = ['sun','mon','tue','wed','thu','fri','sat'] > > for day in week[week.index('tue'):week.index('fri')]: > > print day > > --------------- > > I think you should provide much more information, primarily why you > want to do this. What is the larger goal you are trying to achieve?
I am just looking for a less verbose, more elegant, way to print a slice of a list. What is hard to understand about that? I am not sure how enumerated types help. -- http://mail.python.org/mailman/listinfo/python-list