Question on Method


#1

Hello, quick question here.

Why will some funcitons like str or len be declared before a variable or string like len(“Parrot”) whilst some others like lower & upper will come after so “Parrot”.lower() or “Parrot”.upper().

Thank you for having a look!


#2

because len() is a built-in function, while .upper() is a method belonging to string class. You will get more about classes and functions later


#3

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