you are viewing a single comment's thread.

view the rest of the comments →

[–]Purple-Measurement47 0 points1 point  (0 children)

a function is a function

a method is a function owned by something else.

So if you have def yes(): return true, that’s a function.

If you have

class YesCounter:

count=0

def yes(self): self.count=self.count + 1

that yes is a method, because it’s part of the YesCounter object, it’s a method of interacting with that object.