I am looking to extend a list and have the following
JavaScript
x
4
1
ListA = list(x)
2
ListB = list(y)
3
ListC = ListA.extend(ListB)
4
This gives ListC
as having <type 'NoneType'>
and I am wondering why this isn’t just a list as well.
Thanks!
Advertisement
Answer
extend
, like many other list operations, operates in-place and returns None. ListA
is modified with the extra elements.