1.

class car():和 class car一样

def read()和 def read(self)不一样

2.

注意

注意:class car1:

                 def __init__(self):

                          self.color =  " "

和   

         class car2:

                 def __init__(self, color)

                         self.color = color

的区别

c = car1()

c.color = "red"

 

c = car2("red")

 

python 简单小知识

 

类;——————>>>> 对象      函数/方法

相关文章:

  • 2021-07-13
  • 2022-12-23
  • 2022-01-13
  • 2021-12-28
  • 2021-08-29
猜你喜欢
  • 2021-12-23
  • 2021-09-19
  • 2021-04-29
  • 2022-02-09
  • 2021-05-16
  • 2021-08-27
  • 2021-09-16
相关资源
相似解决方案