Last answered:

15 Mar 2022

Posted on:

27 Feb 2022


About the method parameters

We have seen during defining a function that the parameters are written inside the parenthesis.
And here the definition of method is written that the object is one of its parameters , from above we can conclude that object should be written inside the parenthesis of method but the method syntax in python is given as object.method(). It is contradicting the definition of method.
Please help me regarding this.

1 answers ( 0 marked as helpful)
Posted on:

15 Mar 2022


Hi Shashank!
Thanks for reaching out.

Both could be used, depending on the situation. Some objects have methods and you can use them and some methods accept as a parameter object and then we can make some modifications of the object in the method.

Hope this helps.

Submit an answer