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


#1

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


#2

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.


#3

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