源码

首页 » 归档 » 源码 » 方法和函数之间的区别,在Python中与C相比

方法和函数之间的区别,在Python中与C相比


我正在使用Code Academy的Python教程,我对方法和函数的定义有点困惑.从教程:

You already know about some of the built-in functions we’ve used on (or to create) strings, such as .upper(), .lower(), str(), and len().

来自C,我认为.upper()和.lower()将被称为方法和len()和str()函数.在本教程中,这些术语似乎可以互换使用.

Python以C的方式区分方法和函数吗?

Difference between a method and a function不同,我问的是Python的细节.术语“方法”和“功能”似乎并不总是遵循链接问题的已接受答案中给出的定义.

(1)

本文由 投稿者 创作,文章地址:https://blog.isoyu.com/archives/fangfahehanshuzhijiandequbiezaipythonzhongyucxiangbi.html
采用知识共享署名4.0 国际许可协议进行许可。除注明转载/出处外,均为本站原创或翻译,转载前请务必署名。最后编辑时间为:9 月 19, 2019 at 04:32 下午

热评文章