Doubt on Strings


Please leave the following link in the post so we can find the unit module, else replace it with a link to the exact lesson:

I am a beginner and was learning about strings. I wanted to know if

parrot = "Norwegian Blue"
print len(parrot)

can run, then why not

parrot = "Norwegian Blue"
print lower(parrot)


I believe because len() is a built-in function to return the length of any object given (string, list, etc.) while the lower method is specific to string types so it follows the str.lower() convention.


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