Len(parrot) vs str.lower() - different format for using different functions


Why do we have different formats for the length and string functions?

Eg. why is it not str(lower) like len(str)

Strings and Console Output


len() is a standard function that returns the length of any iterable object.

str() is a standard function that returns a str representation of whatever is passed to it.

.lower() is a method of the str() class, and can only be invoked on string objects.


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.