class Student:
def __init__(self, study_name: int, school_name: str):
self.name = study_name
self.school_name = school_name
def go_school(self, school: str):
print("在" + school + self.school_name + "上学")

class SmallStudent(Student):
def go_school(self, school):
print("在" + school + self.school_name + "上学")

class BigStudent(Student):
def go_school(self, school):
print("在" + school + self.school_name + "上学")



s1 = SmallStudent(1,"小学")
s2 = BigStudent(2,"大学")

s1.go_school("西安")
s2.go_school("西电")
posted on 2025-10-31 11:54  偷懒的阿贤  阅读(0)  评论(0)    收藏  举报