提交 72067d92 编写于 作者: 檀越@新空间's avatar 檀越@新空间 🐭

fix:成员方法

上级 97d9a443
......@@ -2,6 +2,7 @@
演示面向对象类中的成员方法定义和使用
"""
# 定义一个带有成员方法的类
class Student:
name = None # 学生的姓名
......@@ -9,7 +10,6 @@ class Student:
def say_hi(self):
print(f"大家好呀,我是{self.name},欢迎大家多多关照")
def say_hi2(self, msg):
print(f"大家好,我是:{self.name}{msg}")
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册