Advertisement
Oppaceted

Untitled

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