Advertisement
Guest User

Untitled

a guest
Feb 18th, 2020
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.91 KB | None | 0 0
  1. class Classroom:
  2.  
  3. def __init__(self, subject, teacher, nstudents, nta = 0, maxstudents = 30):
  4. self.subject = subject
  5. self.teacher = teacher
  6. self.students = nstudents
  7. self.nta = nta
  8. self.maxstudents = maxstudents
  9.  
  10. def getsubject(self):
  11. return self.subject
  12.  
  13. def getteacher(self):
  14. return self.teacher
  15.  
  16. def getnstudents(self):
  17. return self.students
  18.  
  19. def getnta(self):
  20. return self.nta
  21.  
  22. def getmaxstudents(self):
  23. return self.maxstudents
  24.  
  25. def setmaxstudents(self, maxval):
  26. self.maxstudnets = maxval
  27.  
  28. def setta(self, ta):
  29. self.nta = ta
  30.  
  31. def addstudent(self, num):
  32. 'increments the number of students in the class by num up to the max'
  33. self.students += 1
  34.  
  35. def dropstudent(self, num):
  36. 'decrements the number of students in the class by num down to 0'
  37. self.students -= 1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement