i have just confronted this situation which i am not able to understand:
In [3]: nk1=range(10) In [4]: nk2=range(11,15) In [5]: nk1.extend(nk2) In [6]: nk1 Out[6]: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 12, 13, 14] In [7]: dir(range(10))==dir(list)==dir(range(11,15))==dir(nk1)==dir(nk2) Out[7]: True In [8]: print range(10).extend(range(11,15)) None as you can see above that i can easily extend nk1, but why not the last statement which is returning None??
why it is returning None in In[8] input (while from In[7] we can see that all are same)???
so do i always have to make instance of range to extend it???
from python docs; i found this; but i am not getting how does above case happened.