09-15-周一_11-25-51
This commit is contained in:
@@ -311,9 +311,9 @@ class Student:
|
||||
return cls.__num
|
||||
|
||||
|
||||
Student('陈松', 18)
|
||||
Student('阿松', 36)
|
||||
Student('松松', 73)
|
||||
Student('张三', 18)
|
||||
Student('李四', 36)
|
||||
Student('王五', 73)
|
||||
print(Student.getNum())
|
||||
```
|
||||
|
||||
@@ -370,7 +370,7 @@ class People:
|
||||
def bmi(self):
|
||||
return self.weight / (self.height**2)
|
||||
|
||||
p1=People('陈松',75,1.85)
|
||||
p1=People('张三',75,1.85)
|
||||
print(p1.bmi)
|
||||
```
|
||||
|
||||
|
Reference in New Issue
Block a user