theritically, i want to know the differences
A function is a standalone block of code defined with def at the module level. It exists independently and is called directly by name. A method is a function that is defined inside a class and is associated with an object (or the class itself). It's called on an instance using dot notation.