题解 | #班级管理#

班级管理

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

class Student:
    def __init__(self, *args):
        self.name1 = args[0]
        self.stu_num1 = args[1]
        self.score1 = args[2]
        self.grade1 = args[3]

    def print(self):
        print(
            f"""{self.name1}'s student number is {self.stu_num1}, and his grade is {self.score1}. He submitted {len(self.grade1.split(' '))} assignments, each with a grade of {self.grade1}
        """
        )


name1 = input()
stu_num1 = input()
score1 = input()
grade1 = input()
stu = Student(name1, stu_num1, score1, grade1)
stu.print()

全部评论

相关推荐

牛客771574427号:恭喜你,华杰
点赞 评论 收藏
分享
评论
点赞
收藏
分享
牛客网
牛客企业服务