day19面向对象编程 一、面向对象的由来 Python中一切皆对象 二、类与对象 class Person: #尽量用驼峰体 #属性 height = 180 weight = 120 #方法 def sleep(self): print('睡觉') person1 = Person() #类的实例化,得到对象 print(person1.height) person1.sleep(