摘要:
1、创建Person类,属性有姓名、年龄、性别,创建方法personInfo,打印这个人的信息2、创建Student类,继承Person类,属性有学院college,班级class,重写父类personInfo方法,调用父类方法打印个人信息外,将学生的学院、班级信息也打印出来,创建方法study参数 阅读全文
posted @ 2019-11-14 15:20
kelly-凯莉
阅读(4248)
评论(0)
推荐(1)
摘要:
_str_方法: 使用:如: class Car: def __init__(self,newWheelNum,newColor): self.wheelNum=newWheelNum self.color=newColor def __str__(self): msg='嘿。。我的颜色是'+sel 阅读全文
posted @ 2019-11-14 15:17
kelly-凯莉
阅读(264)
评论(0)
推荐(0)

浙公网安备 33010602011771号