List insert(i, x)

2019-06-19 20:03栏目:技术创新

#Insert an item at a given position. The first argument is the index of the element 
#before which to insert, so a.insert(0, x) inserts at the front of the list, 
#and a.insert(len(a), x) is equivalent to a.append(x). 

a = [66.25, 333, 333, 1, 1234.5]

a.insert(2, -1)

print a

版权声明:本文由新浦京娱乐站_新浦京娱乐场官网_新浦京娱乐发布于技术创新,转载请注明出处:List insert(i, x)