list.insert

s.insert(i, x) same as s[i:i] = [x] (5)

When a negative index is passed as the first parameter to the list.insert method, the list length is added, as for slice indices. If it is still negative, it is truncated to zero, as for slice indices.

Changed in version 2.3: Previously, all negative indices were truncated to zero.

 

A Django site. rendered by a django application. hosted by webfaction.