What is the difference between function and method in Python with an example program?
methods are associated with the objects of the class belong to. Functions are not associated with any object. We can invoke a function just by its name.
For example, string.split(" ") is method of string, and range() is a function in Python.
What can you do if you come across a method or function that you have never seen before?
Use the help() function; the input is the name of the method or function