题解 | #班级管理#

班级管理

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

class Student:
    def __init__(self,name,stuno,score,grade):
        self.__name = name
        self.__stuno = stuno
        self.__score = score
        self.__grade = grade
        
    def printInfo(self):        
        print(f"{self.__name}'s student number is {self.__stuno}, and his grade is {self.__score}. He submitted {len(self.__grade)} assignments, each with a grade of {' '.join(self.__grade)}")
        
        
name = input()
stuno = input()
score = int(input())
grade = input().split()

s = Student(name, stuno, score, grade)
s.printInfo()
全部评论

相关推荐

评论
点赞
收藏
分享
牛客网
牛客企业服务