The behavior of List.insert

York yorklee70 at yahoo.com
Tue Apr 29 12:16:31 EDT 2003


Hi, 

given

mylist = [1,2,3,4,5], 

mylist.insert(-1,99) will make mylist to be [99,1,2,3,4,5]

just wonder why not let it to be [1,2,3,4,99,5]

Thanks,

York




More information about the Python-list mailing list