Ingrid Matthews1,465 Points
What is the difference between function(thing) and thing.function()?
This is a basic question, I'm not referring to a specific code here. Trying to understand these two kinds of syntax.
Victor MercierTreehouse Moderator 13,699 Points
In the first case, you are passing an argument to a function For example:
# Define a function `plus()` def plus(a,b): return a + b
To call the function, you would do plus(2,3)
In the second case, you are calling a method on an object: For example:
# Create a `Summation` class class Summation(object): def sum(self, a, b): self.contents = a + b return self.contents
To call the function on the method, you would be doing Summation.sum(1,2) If that helped you , do not forget to mark as best answer to indicate your issue is resolved!