题解 | 班级管理

class Student:
    def __init__(self,student_name,studentID,points,grades):
        self.student_name=student_name
        self.studentID=studentID
        self.points=points
        self.grades=grades
        
    def information(self):
        print(f"{self.student_name}'s student number is {self.studentID}, and his grade is {self.points}. He submitted {len(self.grades)} assignments, each with a grade of {' '.join(self.grades)}")

student_name=input()
studentID=input()
points=int(input())
grade=input().split(" ")
student=Student(student_name,studentID,points,grade)
student.information()

    

全部评论

相关推荐

06-26 10:08
门头沟学院 C++
北京Golang实习,一个月4700,吃住都不报,公司位置在海淀。请问友友怎么看呢?如果要租房的话有什么建议吗
码农索隆:租房肯定是合租了,剩下的钱,差不多够正常吃饭了,看看能不能学到东西吧
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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