Advertisement
Guest User

Untitled

a guest
Jun 25th, 2019
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. def __init__(self, name, major, physicsLevel, mathLevel, chemistryLevel, gpa, is_on_probation):
  2. self.name = name
  3. self.physicsLevel = physicsLevel
  4. self.mathLevel = mathLevel
  5. self.chemistryLevel = chemistryLevel
  6. self.major = major
  7. self.gpa = gpa
  8. self.is_on_probation = is_on_probation
  9.  
  10. def __str__(self):
  11. return f"{self.name}, {self.major}, {self.gpa}, {self.physicsLevel}"
  12.  
  13. def on_honor_roll(self): # function placed inside a class, in this case whether student is on honor roll through level of gpa
  14. if self.gpa >= 3.5:
  15. return True
  16. else:
  17. return False
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement