Why Python doesn't provide methods to be called on a list for finding length like L.len()

Viewed 41

If there is a list L in python to find its length, we do len(L) whereas if the programming language is Java, it would have been something like L.len(), i.e., you call the length function on the list. I am from a java background and learning python. I found it a little weird to use len(L). But I understand there is some thought process behind this. Why didn't python provide a method for finding the length of a list like in java?

0 Answers
Related