Function is defined independently. Method is defined inside a class and receives self as the first argument.
1# Function2def greet(name):3 return f"Hello, {name}"45print(greet("Alice")) # "Hello, Alice"67# Method8class Greeter:9 def greet(self, name): # self = instance10 return f"Hello, {name}"1112g = Greeter()13print(g.greet("Alice")) # "Hello, Alice"
Key difference: Method is associated with an object (has access to self).