Is there a better way to chose a slice of a list?

walterbyrd walterbyrd at iname.com
Fri May 8 15:03:49 EDT 2009


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
---------------




More information about the Python-list mailing list