题解 | #班级管理#
班级管理
https://www.nowcoder.com/practice/e5539db11767449ab2fb68ed3c2446d0
class Student: def __init__(self, name, stnm, grade, level): self.name = name self.stnm = stnm self.grade = grade self.level = level def info(self): print(f"{self.name}'s student number is {self.stnm}, and his grade is {self.grade}. He submitted {len(self.level)} assignments, each with a grade of {' '.join(self.level)}") name, stnm, grade, level = input(), input(), input(), input() stu1 = Student(name, stnm, grade, level.split(' ')) stu1.info()