Len(str) and str.upper(),


len(str) and str.upper(), why not str.len()?


len() is a built in function for determining length of an iterable such as a string or a list. It is not a member method of the String or List classes, but a stand alone function.

str.upper() is a member method of the String class, We don't pass an argument. Instead, the method acts upon the owner object context, in this case str.


Thanks, that was clear!


A post was split to a new topic: Strings - need help on this part