functions vs methods

Lele Gaifax lele at
Sat Jul 21 17:05:35 EDT 2018

Sharan Basappa <sharan.basappa at> 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

ciao, lele.
nickname: Lele Gaifax | Quando vivrò di quello che ho pensato ieri
real: Emanuele Gaifas | comincerò ad aver paura di chi mi copia.
lele at  |                 -- Fortunato Depero, 1929.

More information about the Python-list mailing list