4/7
选课系统项目中涉及到诸多数据与功能,要求引入面向对象的思想对其进行高度整合 # # 1、学校数据与功能整合class school: def __init__(self, school_name, school_adress): self.name = school_name self.adrss = school_adress def info(self): print(f'校名{self.name},地址{self.adrss}')school.obj = school('oldboy', '上海青浦')school.info(school.obj)# # 2、课程数据与功能进行整合class course: def __init__(self, name, period, price): self.name = name self.period = period self.price = price def info(self): print(f'课程{self.name},课程周期{self.period},课程价格{self.price}')course_obj = course('课程A', '14天', '20块')course_obj.info()# # 3、学生数据与功能进行整合class classmates: def __init__