Advertisement
Oppaceted

classes

Feb 22nd, 2024
1,057
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.78 KB | None | 0 0
  1. from random import randint
  2.  
  3. class Abiturient:
  4.     def __init__(self, ID: int ) -> None:
  5.         self.ID = ID
  6.    
  7. class Teacher:
  8.     def __init__(self, allAbiturients: list ) -> None:
  9.         #self.Abiturient = Abiturient
  10.         self.allAbiturients = allAbiturients
  11.  
  12.     def testAbiturients(self):
  13.         dictAbiturients = {}
  14.         for element in self.allAbiturients:
  15.             dictAbiturients[randint(0, 100)] = element
  16.         return dictAbiturients
  17.  
  18. class Faculty:
  19.     def __init__(self, name: str, maxNumberOfStudents: int):
  20.         self.name = name
  21.         self.maxNumberOfStudents = maxNumberOfStudents
  22.  
  23.     def returnPassedAbiturients(self, dictAbiturients: dict) -> list:
  24.         return sorted(dictAbiturients.keys(), reverse=True)[:self.maxNumberOfStudents:]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement