题解 | #班级管理#
班级管理
https://www.nowcoder.com/practice/e5539db11767449ab2fb68ed3c2446d0
class Student: def __init__(self,name,student_id,score,grade): self.name = name self.student_id = student_id self.score = score self.grade = grade self.len = len(self.grade.split()) def __str__(self): return f"{self.name}'s student number is {self.student_id}, and his grade is {self.score}. He submitted {(self.len)} assignments, each with a grade of {self.grade}" a = input() b = input() c = int(input()) d = input() shit = Student(a,b,c,d) print(shit)#pyhton#