-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathEtudiant.py
58 lines (51 loc) · 1.65 KB
/
Etudiant.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
__author__ = 'pehladik'
class Etudiant:
def __init__(self, id, nom, prenom, classement, filiere, choix1, choix2, choix3):
self.id = id
self.nom = nom
self.prenom = prenom
self.classement = classement
self.filiere = filiere
self.filieractuelle = None
self.choix1 = choix1
self.choix2 = choix2
self.choix3 = choix3
self.choixfinal = None
self.explications = ''
self.explicationsChoix = []
def __str__(self):
st = "id: " + str(self.id)
st += ", nom: " + self.nom
st += ", prenom: " + self.prenom
st += ", classement: " + str(self.classement)
st += ", filiere: " + self.filiere
if self.choix1 != None:
st += ", choix1: " + self.choix1
if self.choix2 != None:
st += ", choix 2: " + self.choix2
if self.choix3 != None:
st += ", choix3: " + self.choix3
if self.choixfinal != None:
st += ", choix: " + self.choixfinal
return st
def est_present(self, id):
return (self.id == id)
def numChoix(self):
if self.choixfinal != None:
if self.choix1 == self.choixfinal:
return 1
elif self.choix2 == self.choixfinal:
return 2
if self.choix3 == self.choixfinal:
return 3
else:
return 4
else :
return 0
def choixUniv(self, numUniv):
if numUniv == 1:
return self.choix1
elif numUniv == 2:
return self.choix2
elif numUniv == 3:
return self.choix3