当前位置:网站首页>函数、方法和接口的区别
函数、方法和接口的区别
2022-07-21 03:20:00 【Hi~晴天大圣】
总结:
函数是语句序列的打包;
方法是对对象成员的操作
接口是对方法的抽象,由方法实现具体的接口;
具体:
1、函数:直接使用函数名(参数1,参数2,…)调用
def functionName():
print("这是一个函数")
#调用
functionName()
2、方法:通过对象方法调用的(这里是指对象方法)
class className:
def method(self):
print("这是一个方法")
#调用
#实例化对象
c=className()
c.method()
边栏推荐
- 05 正则表达式语法
- [OBS] release signed construction based on cmake
- The first lesson of programmers is "Hello word". Do you know the first lesson of network engineering?
- Jujube technology CEO's monthly DDC briefing (phase III) -- Introduction to new functions of DDC network and review of essence of Wenchang chain upgrade plan
- Comparing swift with OC, the core idea of swift is protocol oriented programming
- Software testing interview questions: black box testing and white box testing are two basic methods of software testing. Please explain their advantages and disadvantages respectively!
- spark rdd,spark SQL的应用案例
- Session 和 Cookies 有什么区别?
- Web APIs DOM page special effects element size and position
- QT(37)-mosquitto-MQTT客户端
猜你喜欢
Phpstudy_ Pro builds sqli labs shooting range for SQL injection test
过滤器 监听器
Naixue's tea layout: how to transform the traditional brand of yuancosmos into yuancosmos marketing
程序员第一课“hello word”,你知道网工第一课吗?
Phpstudy_pro搭建Sqli-labs靶场,进行SQL注入测试
hcip第二天实验
According to the framework's swagger interface document
PostgreSQL source code (64) query execution - sub module executor (2) data structure and execution process before execution
Light the first LED
Configuration du Service FTP
随机推荐
Web APIs DOM- 网页特效篇-元素大小和位置
Don't be silly to distinguish these kinds of storage volumes of kubernetes
Kingbasees v8r6 is there any way to not read sys by default_ System view under catalog?
Software testing interview question: what work is usually done in each stage of software testing? What are the outcome documents of each stage? What is included?
Practice and exploration of knowledge atlas question answering Technology
Translation and interpretation of the paper: anytime bottom up rule learning for knowledge graph completion [anyburr]
06 提取数据的json字符串
软件测试面试题:Internet采用哪种网络协议?该协议的主要层次结构?Internet物理地址和IP地址转换采用什么协议?
Comparing swift with OC, the core idea of swift is protocol oriented programming
liunx 批量杀死同名进程
解决跨域问题的8种方案(最新最全)
C语言进阶(十四) - 文件管理
软件测试面试题:在您以往的工作中,一条软件缺陷(或者叫Bug)记录都包含了哪些内容?如何提交高质量的软件缺陷(Bug)记录?
Pytorch环境搭建
spark rdd,spark SQL的应用案例
MYSQL09_ Elaborate on database data types
kubernetes的这几种存储卷,别再傻傻分不清了
软件测试面试题:软件测试的策略是什么?
[experience sharing] mathematical modeling paper format requirements and summary of common problems
Ardunio development - I2C protocol communication - control 2x16lcd