Skip to main content
The 2026 Annual Developer Survey is live— take the Survey today!

Timeline for answer to What does [:-1] mean/do in python? by Kartik

Current License: CC BY-SA 3.0

Post Revisions

3 events
when toggle format what by license comment
Mar 20, 2013 at 21:45 history edited Kartik CC BY-SA 3.0
deleted 1 characters in body
Mar 20, 2013 at 21:42 comment added abarnert This is written ambiguously enough to be confusing. It's all of the elements up to but not including the last element. (If you already know how slices/ranges/etc. work in Python, then knowing that -1 is the last element tells you everything you need… but if you don't, you still won't after this answer.)
Mar 20, 2013 at 21:37 history answered Kartik CC BY-SA 3.0