why len(list) instead of list.len() ?

Markus Jais mjais at web.de
Tue Jun 18 03:27:37 EDT 2002


hello

I way wondering why one has to write

list = [2, 3, 5]
print len(list)

instead of list.len()

in Ruby I can write 

array = [2, 3, 4]
puts array.length()


which feels more intuitive to me

please, I do not want to start a flame war
Ruby <-> Python
I like and use both !!

maybe there is something like that for python
and I have just not found it.

markus



More information about the Python-list mailing list