Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why when I extend a list does it have 'NoneType' as type?

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!

like image 372
Taylrl Avatar asked Oct 28 '25 12:10

Taylrl


1 Answers

extend, like many other list operations, operates in-place and returns None. ListA is modified with the extra elements.

like image 149
Daniel Roseman Avatar answered Oct 30 '25 02:10

Daniel Roseman



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!