Sharan Basappa <sharan.basa...@gmail.com> writes: > Refer to the following lines: > 1) len(list) > 2) list.append() > > In the first case, len is a function that python provides to which list can > be passed and in the second case, append is a method within list class? > > If my interpretation is correct, why not make len also as a part of list > class itself?
Yes, that's correct. For the reason, see https://docs.python.org/3/faq/design.html#why-does-python-use-methods-for-some-functionality-e-g-list-index-but-functions-for-other-e-g-len-list ciao, lele. -- nickname: Lele Gaifax | Quando vivrò di quello che ho pensato ieri real: Emanuele Gaifas | comincerò ad aver paura di chi mi copia. l...@metapensiero.it | -- Fortunato Depero, 1929. -- https://mail.python.org/mailman/listinfo/python-list