Doubt on Strings


#1

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:

https://www.codecademy.com/courses/learn-python/lessons/strings--console-output/exercises/lower?action=lesson_resume&link_content_target=interstitial_undefined

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)


#2

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.


#3

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