常见术语

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/a184251289/article/details/81060832

术语

名称 译文
argument 实参
attribute 属性
base class 基本类
block
character 字符
class
comment 注释
complex number 复数
derived class 导出类
dictionary 字典
escape sequence 转义符
exception 异常
expression 表达式
field
float 浮点数
function 函数
identifier 标识符
indentation 缩进
indexing 索引
instance 实例
list 列表
list comprehension 列表综合
literal constant 字面意义上的常量
logical line 逻辑行
long integer 长整数
method 方法
module 模块
namespace 名称空间
object 对象
operand 运算符
parameter 形参
pickle 储存器
physical line 物理行
sequence 序列
shebang line 组织行
slicing 切片
statement 语句
string 字符串
subclass 子类
superclass 超类
tuple 元组
type 类型
variable 变量

一、 function VS method

方法和对象相关;函数和对象无关。
Java中只有方法,C中只有函数,而C++里取决于是否在类中。


二、 argument VS parameter

parameter:形参,指的是函数中的参数名称:
def add(x,y):>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>此处x,y为形参。
return x+y

argument:实参,指的是你提供给函数调用的值:
x=1
y=2
add(x,y)>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>此处x,y就变为实参了。


摘要

https://blog.csdn.net/qq_34952846/article/details/78943800
https://www.zhihu.com/question/24539277?sort=created

猜你喜欢

转载自blog.csdn.net/a184251289/article/details/81060832
今日推荐