SyntaxFix
Write A Post
Hire A Developer
Questions
You'll have to pass the new ordinal position to insert using len in this case:
insert
len
In [62]: a=[1,2,3,4] a.insert(len(a),5) a Out[62]: [1, 2, 3, 4, 5]