题解 | #班级管理#

班级管理

https://www.nowcoder.com/practice/e5539db11767449ab2fb68ed3c2446d0

class Student(object):
    def __init__(self, name, number, score, grade):
        self.name = name
        self.number = number
        self.score = score
        self.grade = grade

    def student_info(self):
        return "%s's student number is %s, and his grade is %s. He submitted %s assignments, each with a grade of %s" % (
            self.name,
            self.number,
            self.score,
            len(self.grade),
            " ".join(self.grade),
        )


name = input()
number = input()
score = input()
grade = list(input().split(" "))
student = Student(name, number, score, grade)
print(student.student_info())

全部评论

相关推荐

2024-11-29 11:43
河南科技大学 Java
铁锈不腻玩家:下面那个袁先生删了,问他怎么回事,头像都换不明白
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客企业服务