题解 | 班级管理

class Student:
    def __init__(self,name,id,grade,grade_list):
            self.name = name
            self.id = id
            self.grade = grade
            self.grade_list = grade_list
name = input()
id = input()
grade = int(input())
grade_list = input().split()
stu = Student(name,id,grade,grade_list)
str = ' '.join(grade_list)
print(f'{stu.name}\'s student number is {stu.id}, and his grade is {stu.grade}. He submitted {len(stu.grade_list)} assignments, each with a grade of '+str)

全部评论

相关推荐

评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客企业服务