From a7f95e5ada17109facfeaf7419d581dbf9f398da Mon Sep 17 00:00:00 2001 From: Billts-noo <141442230+Billts-noo@users.noreply.github.com> Date: Thu, 11 Jul 2024 16:01:07 +0800 Subject: [PATCH] Add files via upload --- student.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 student.py diff --git a/student.py b/student.py new file mode 100644 index 0000000..7634d72 --- /dev/null +++ b/student.py @@ -0,0 +1,14 @@ +class Student: + """学生类""" + + def __init__(self,name,gender): + """初始化学生信息""" + self.name = name + self.gender = gender + + def __str__(self) -> str: + return f'姓名:{self.name} 性别:{self.gender}' + + def change_info(self,new_name,new_gender): + self.name = new_name + self.gender = new_gender