活力书本

文章
4
资源
0
加入时间
3年1月23天

Python进阶与提高3--面向对象封装案例

一、小明爱跑步需求:1、小明体重 75公斤2、小明每次跑步体重会减少0.5公斤3、小明每次吃东西体重会增加1公斤class Person: def __init__(self, new_name, new_weight): self.name = new_name self.weight = new_weight def run(self)...