I am looking to extend a list and have the following
ListA = list(x) ListB = list(y) ListC = ListA.extend(ListB)
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.