1、类和实例
类是抽象的模板
例是根据类创建出来的一个个具体的“对象”
例:
class Student(object):
bart = Student()bart
<main.Student object at 0x10a67a590> # 0x10a67a590是个内存地址
Student
<class ‘main.Student’>
bart是个变量
student()是个实例
student是个类
2、type & rtype
type: Type of a parameter.
vartype: Type of a variable.
rtype: Return type. (函数返回的数据的类型)
最后
以上就是等待未来最近收集整理的关于刷leetcode的第一天的全部内容,更多相关刷leetcode内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复