类的学习笔记

类 类的作用是用来封装事物的属性和描述,当类作为一个模块时,建议不要在模块中实例化和调用类。  类变量、实例变量、实例方法 class Student: name = 'will' age = 0 sum = 0 def __init__(self,name,age): self.name = name self.age = age
相关文章
相关标签/搜索