题解 | #班级管理#

班级管理

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#
全部评论

相关推荐

喜欢走神的孤勇者练习时长两年半:池是池,发是发,我曾池,我现黑
点赞 评论 收藏
分享
3 收藏 评论
分享
牛客网
牛客企业服务