Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Student:
- def __init__(self, name, year):
- self.name = name
- self.year = year
- self.grades = []
- def add_grade(self, grade):
- if type(grade) is Grade:
- self.grades.append(grade)
- class Grade:
- minimum_passing = 65
- def __init__(self, score):
- self.score = score
- roger = Student("Roger van der Weyden", 10)
- sandro = Student("Sandro Botticelli", 12)
- pieter = Student("Pieter Bruegel the Elder", 8)
- pieter.add_grade(Grade(100))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement