While programming with python I am often confused with the following ambiguity:
should it be: function(a) or a.function(). Although the question is too general and can someone tell me which situation happens when?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
When you call it like a.function() you are calling a method named “function” from the object named “a”.
If you don’t know the difference between a method and a function/procedure, you need to study Object Oriented Programming concepts.