Skip to content
Snippets Groups Projects
Commit d01da08d authored by Angy Wallot's avatar Angy Wallot
Browse files

tp.4

parent b2a389ad
No related branches found
No related tags found
No related merge requests found
......@@ -9,7 +9,6 @@
"""
from date import Date
class Etudiant:
"""
une classe représentant des étudiants.
......@@ -49,7 +48,12 @@ class Etudiant:
précondition : le nip, le nom et le prénom ne peuvent être nuls ou vides.
"""
...
self.nip = init_nip
self.nom = init_nom
self.prenom = init_prenom
self.naissance = init_naissance
self.formation = init_formation
self.groupe = init_groupe
def __eq__(self, other) -> bool:
"""
......@@ -59,7 +63,9 @@ class Etudiant:
- même prénom que `self`,
et False sinon.
"""
...
return self.nip == other.nip and\
self.nom == other.nom and\
self.prenom == other.prenom
def __lt__(self, other) -> bool:
"""
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment