函数与方法的区别

随着我们越来越频繁使用Python, 我们难免会接触到类, 接触到类属性和方法.但是很多新手包括我, 不知道方法  函数 的区别,这次简单来讨论下, 如果有哪里认识不正确, 希望大神提点指教!
先来看两个定义吧:

function(函数) —— A series of statements which returns some value toa caller. It can also be passed zero or more arguments which may beused in the execution of the body.
method(
方法) —— A function which is defined inside a class

你可能感兴趣的:(python,python,开发语言)