The insert function of a List doesn't return anything, hence you get None. See docs for more details.
insert
List
None
You can try this:
values = ['foo', 'bar'] values.insert(1, 'hey') print(values)
Output:
['foo', 'hey', 'bar']
2.1m questions
2.1m answers
60 comments
57.0k users