Slice confusion : a[n:p] is a list exclude the last element p

nguyen khanh phuoc-khanh.nguyen at
Mon Apr 28 14:25:26 CEST 2003

Why the design exclude the last element ?
I's because the distinction of "element and list-element" ?
a[3]=3        # element
a[3:4]=[3]   # list-element

Why the designer d'nt use a[3:3]=[3] instead of a[p:p]=[] ?
The result a[p:p]=[] for all p d'nt add new information ,
The design a[n:p] clarify the mind to include the last element p .
and a[p:p]=[p] is very clear and dinctint from a[p]=p .

Thank to advise me your idea about the circus-slice notion .
Faithfull .
A Pythonian construct .
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the Python-list mailing list