题解 | #班级管理#

班级管理

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

相关推荐

积极的小学生不要香菜:你才沟通多少,没500不要说难
点赞 评论 收藏
分享
05-29 22:11
门头沟学院 Java
Elastic90:抛开学历造假不谈,这公司的招聘需求也挺怪的,Java开发还要求你有图文识别、移动端开发和c++的经验,有点逆天了。
点赞 评论 收藏
分享
不愿透露姓名的神秘牛友
昨天 11:00
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务