What is the primary difference between a Python function and a method?
A method is associated with a specific object or class, while a function is defined independently.
How is a Python function typically defined?
Using the def keyword outside of any class structure.
How is a Python method typically defined?
As a function defined inside a class.
What is the syntax for calling a function?
By its name: function_name(args) (e.g., len(my_list)).
What is the syntax for calling a method?
On an object using dot notation: object.method_name(args) (e.g., my_list.append(5)).
What is the conventional first argument for a method that allows it to operate on the object’s data?
self