Add files via upload

This commit is contained in:
Billts-noo 2024-07-11 16:01:07 +08:00 committed by GitHub
parent 7439cdc5ab
commit a7f95e5ada
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

14
student.py Normal file
View File

@ -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